@@ -9738,7 +9738,6 @@ out:
free_root_recs_tree(&root_cache);
close_out:
close_ctree(root);
- btrfs_close_all_devices();
err_out:
if (ctx.progress_enabled)
task_deinit(ctx.info);
@@ -139,7 +139,6 @@ static int cmd_device_add(int argc, char **argv)
error_out:
close_file_or_dir(fdmnt, dirstream);
- btrfs_close_all_devices();
return !!ret;
}
@@ -288,7 +287,6 @@ static int cmd_device_scan(int argc, char **argv)
}
out:
- btrfs_close_all_devices();
return !!ret;
}
@@ -466,7 +464,6 @@ static int cmd_device_stats(int argc, char **argv)
out:
free(di_args);
close_file_or_dir(fdmnt, dirstream);
- btrfs_close_all_devices();
return err;
}
@@ -330,7 +330,6 @@ static int cmd_replace_start(int argc, char **argv)
}
}
close_file_or_dir(fdmnt, dirstream);
- btrfs_close_all_devices();
return 0;
leave_with_error:
@@ -340,7 +339,6 @@ leave_with_error:
close(fdmnt);
if (fddstdev != -1)
close(fddstdev);
- btrfs_close_all_devices();
return 1;
}
Since we have btrfs_close_all_devices() in btrfs's main entrance, it is not necessary to call btrfs_close_all_devices() separately in each sub-command. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> --- cmds-check.c | 1 - cmds-device.c | 3 --- cmds-replace.c | 2 -- 3 files changed, 6 deletions(-)