return ret;
}
+static int snapshot_is_being_created(struct snapshot *s)
+{
+ return s->creation_time == current_snapshot_creation_time;
+}
+
/*
* return: 0: no redundant snapshots, 1: rm process started, negative: error
*/
FOR_EACH_SNAPSHOT(s, i, sl) {
int64_t this_score;
+ if (snapshot_is_being_created(s))
+ continue;
//DSS_DEBUG_LOG("checking %s\n", s->name);
if (s->interval > interval) {
prev = s;
DSS_DEBUG_LOG("looking for snapshots belonging to intervals greater than %d\n",
conf.num_intervals_arg);
FOR_EACH_SNAPSHOT(s, i, sl) {
+ if (snapshot_is_being_created(s))
+ continue;
if (s->interval <= conf.num_intervals_arg)
continue;
if (conf.dry_run_given) {
if (!s) /* no snapshot found */
return 0;
DSS_INFO_LOG("oldest snapshot: %s\n", s->name);
- if (s->creation_time == current_snapshot_creation_time)
- return 0; /* do not remove the snapshot currently being created */
+ if (snapshot_is_being_created(s))
+ return 0;
return remove_snapshot(s);
}