提交 3acbcbfc 编写于 作者: A Anand Jain 提交者: David Sterba

btrfs: drop devid as device_list_add() arg

As struct btrfs_disk_super is being passed, so it can get devid
the same way its parent does.
Signed-off-by: NAnand Jain <anand.jain@oracle.com>
Reviewed-by: NJosef Bacik <jbacik@fb.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 e124ece5
...@@ -728,12 +728,13 @@ static int btrfs_open_one_device(struct btrfs_fs_devices *fs_devices, ...@@ -728,12 +728,13 @@ static int btrfs_open_one_device(struct btrfs_fs_devices *fs_devices,
* error pointer when failed * error pointer when failed
*/ */
static noinline struct btrfs_device *device_list_add(const char *path, static noinline struct btrfs_device *device_list_add(const char *path,
struct btrfs_super_block *disk_super, u64 devid) struct btrfs_super_block *disk_super)
{ {
struct btrfs_device *device; struct btrfs_device *device;
struct btrfs_fs_devices *fs_devices; struct btrfs_fs_devices *fs_devices;
struct rcu_string *name; struct rcu_string *name;
u64 found_transid = btrfs_super_generation(disk_super); 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); fs_devices = find_fsid(disk_super->fsid);
if (!fs_devices) { if (!fs_devices) {
...@@ -1181,7 +1182,6 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, ...@@ -1181,7 +1182,6 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
struct block_device *bdev; struct block_device *bdev;
struct page *page; struct page *page;
int ret = 0; int ret = 0;
u64 devid;
u64 bytenr; u64 bytenr;
/* /*
...@@ -1205,9 +1205,7 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, ...@@ -1205,9 +1205,7 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
goto error_bdev_put; goto error_bdev_put;
} }
devid = btrfs_stack_device_id(&disk_super->dev_item); device = device_list_add(path, disk_super);
device = device_list_add(path, disk_super, devid);
if (IS_ERR(device)) if (IS_ERR(device))
ret = PTR_ERR(device); ret = PTR_ERR(device);
else else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册