[PATCH v2 2/5] btrfs-progs: Remove all btrfs_close_all_devices in sub-command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 cmds-check.c   | 1 -
 cmds-device.c  | 3 ---
 cmds-replace.c | 2 --
 3 files changed, 6 deletions(-)

diff --git a/cmds-check.c b/cmds-check.c
index 1f8caad..3af6e61 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -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);
diff --git a/cmds-device.c b/cmds-device.c
index 5f2b952..620ae8b 100644
--- a/cmds-device.c
+++ b/cmds-device.c
@@ -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;
 }
diff --git a/cmds-replace.c b/cmds-replace.c
index 9ab8438..fadd2cd 100644
--- a/cmds-replace.c
+++ b/cmds-replace.c
@@ -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;
 }
 
-- 
1.8.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux