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.j...@oracle.com>
---
 fs/btrfs/volumes.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

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;
-- 
2.7.0

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

Reply via email to