diff mbox

[4/5] btrfs: drop devid as device_list_add() arg

Message ID 20180109144625.28381-5-anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Anand Jain Jan. 9, 2018, 2:46 p.m. UTC
As struct btrfs_disk_super is being passed, so it can get devid
the same way its parent does.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/volumes.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Josef Bacik Jan. 9, 2018, 4:14 p.m. UTC | #1
On Tue, Jan 09, 2018 at 10:46:24PM +0800, Anand Jain wrote:
> As struct btrfs_disk_super is being passed, so it can get devid
> the same way its parent does.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>

Reviewed-by: Josef Bacik <jbacik@fb.com>

Thanks,

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

Patch

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 2317ca1b3d83..f942e8193862 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -732,12 +732,13 @@  static int btrfs_open_one_device(struct btrfs_fs_devices *fs_devices,
  */
 static noinline int device_list_add(const char *path,
 			   struct btrfs_super_block *disk_super,
-			   u64 devid, struct btrfs_device **device_ret)
+			   struct btrfs_device **device_ret)
 {
 	struct btrfs_device *device;
 	struct btrfs_fs_devices *fs_devices;
 	struct rcu_string *name;
 	u64 found_transid = btrfs_super_generation(disk_super);
+	u64 devid = btrfs_stack_device_id(&disk_super->dev_item);
 
 	fs_devices = find_fsid(disk_super->fsid);
 	if (!fs_devices) {
@@ -1187,7 +1188,6 @@  int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
 	struct block_device *bdev;
 	struct page *page;
 	int ret;
-	u64 devid;
 	u64 bytenr;
 
 	/*
@@ -1208,10 +1208,8 @@  int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
 		goto error_bdev_put;
 	}
 
-	devid = btrfs_stack_device_id(&disk_super->dev_item);
-
 	mutex_lock(&uuid_mutex);
-	ret = device_list_add(path, disk_super, devid, &device);
+	ret = device_list_add(path, disk_super, &device);
 	mutex_unlock(&uuid_mutex);
 
 	*fs_devices_ret = device->fs_devices;