Instead of using a dirty-subvolumn-counter in old code, this patch
turn to use a simple and direct way:
If (not dirty-subvolumn found in current loop) {
return all_clean;
}
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
int sleep_interval)
{
int ret;
- int remaining;
int i;
- remaining = count;
while (1) {
+ int clean = 1;
+
for (i = 0; i < count; i++) {
if (!ids[i])
continue;
fprintf(stderr,
"ERROR: can't perform the search - %s\n",
strerror(-ret));
- goto out;
+ return ret;
}
if (ret) {
printf("Subvolume id %llu is gone\n", ids[i]);
ids[i] = 0;
- remaining--;
+ } else {
+ clean = 0;
}
}
- if (!remaining)
+ if (clean == 0)
break;
sleep(sleep_interval);
}
- ret = 0;
-out:
- return ret;
+ return 0;
}
static const char * const subvolume_cmd_group_usage[] = {