Pārlūkot izejas kodu

btrfs: rename btrfs_close_extra_device to btrfs_free_extra_devids

This function btrfs_close_extra_devices() is about freeing
extra devids which once it may have belonged to this filesystem.
So rename it and add the comment. The _devid suffix is
appropriate as this function won't handle devices which are
outside of the filesytem being mounted.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Anand Jain 7 gadi atpakaļ
vecāks
revīzija
9b99b11564
3 mainītis faili ar 10 papildinājumiem un 6 dzēšanām
  1. 4 4
      fs/btrfs/disk-io.c
  2. 5 1
      fs/btrfs/volumes.c
  3. 1 1
      fs/btrfs/volumes.h

+ 4 - 4
fs/btrfs/disk-io.c

@@ -2758,10 +2758,10 @@ int open_ctree(struct super_block *sb,
 	}
 	}
 
 
 	/*
 	/*
-	 * keep the device that is marked to be the target device for the
-	 * dev_replace procedure
+	 * Keep the devid that is marked to be the target device for the
+	 * device replace procedure
 	 */
 	 */
-	btrfs_close_extra_devices(fs_devices, 0);
+	btrfs_free_extra_devids(fs_devices, 0);
 
 
 	if (!fs_devices->latest_bdev) {
 	if (!fs_devices->latest_bdev) {
 		btrfs_err(fs_info, "failed to read devices");
 		btrfs_err(fs_info, "failed to read devices");
@@ -2824,7 +2824,7 @@ retry_root_backup:
 		goto fail_block_groups;
 		goto fail_block_groups;
 	}
 	}
 
 
-	btrfs_close_extra_devices(fs_devices, 1);
+	btrfs_free_extra_devids(fs_devices, 1);
 
 
 	ret = btrfs_sysfs_add_fsid(fs_devices, NULL);
 	ret = btrfs_sysfs_add_fsid(fs_devices, NULL);
 	if (ret) {
 	if (ret) {

+ 5 - 1
fs/btrfs/volumes.c

@@ -896,7 +896,11 @@ error:
 	return ERR_PTR(-ENOMEM);
 	return ERR_PTR(-ENOMEM);
 }
 }
 
 
-void btrfs_close_extra_devices(struct btrfs_fs_devices *fs_devices, int step)
+/*
+ * After we have read the system tree and know devids belonging to
+ * this filesystem, remove the device which does not belong there.
+ */
+void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step)
 {
 {
 	struct btrfs_device *device, *next;
 	struct btrfs_device *device, *next;
 	struct btrfs_device *latest_dev = NULL;
 	struct btrfs_device *latest_dev = NULL;

+ 1 - 1
fs/btrfs/volumes.h

@@ -422,7 +422,7 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
 int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
 int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
 			  struct btrfs_fs_devices **fs_devices_ret);
 			  struct btrfs_fs_devices **fs_devices_ret);
 int btrfs_close_devices(struct btrfs_fs_devices *fs_devices);
 int btrfs_close_devices(struct btrfs_fs_devices *fs_devices);
-void btrfs_close_extra_devices(struct btrfs_fs_devices *fs_devices, int step);
+void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step);
 void btrfs_assign_next_active_device(struct btrfs_fs_info *fs_info,
 void btrfs_assign_next_active_device(struct btrfs_fs_info *fs_info,
 		struct btrfs_device *device, struct btrfs_device *this_dev);
 		struct btrfs_device *device, struct btrfs_device *this_dev);
 int btrfs_find_device_missing_or_by_path(struct btrfs_fs_info *fs_info,
 int btrfs_find_device_missing_or_by_path(struct btrfs_fs_info *fs_info,