@@ -3290,8 +3290,7 @@ int btrfs_start_pre_rw_mount(struct btrfs_fs_info *fs_info)
return ret;
}
-int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_devices,
- char *options)
+int __cold open_ctree(struct super_block *sb, char *options)
{
u32 sectorsize;
u32 nodesize;
@@ -3301,6 +3300,7 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
u16 csum_type;
struct btrfs_super_block *disk_super;
struct btrfs_fs_info *fs_info = btrfs_sb(sb);
+ struct btrfs_fs_devices *fs_devices = fs_info->fs_devices;
struct btrfs_root *tree_root;
struct btrfs_root *chunk_root;
int ret;
@@ -3309,6 +3309,9 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
fs_info->sb = sb;
+ /* Caller should have already initialized fs_info->fs_devices. */
+ ASSERT(fs_info->fs_devices);
+
ret = init_mount_fs_info(fs_info);
if (ret) {
err = ret;
@@ -42,9 +42,7 @@ struct extent_buffer *btrfs_find_create_tree_block(
void btrfs_clean_tree_block(struct extent_buffer *buf);
void btrfs_clear_oneshot_options(struct btrfs_fs_info *fs_info);
int btrfs_start_pre_rw_mount(struct btrfs_fs_info *fs_info);
-int __cold open_ctree(struct super_block *sb,
- struct btrfs_fs_devices *fs_devices,
- char *options);
+int __cold open_ctree(struct super_block *sb, char *options);
void __cold close_ctree(struct btrfs_fs_info *fs_info);
int btrfs_validate_super(struct btrfs_fs_info *fs_info,
struct btrfs_super_block *sb, int mirror_num);
@@ -1429,7 +1429,6 @@ static int get_default_subvol_objectid(struct btrfs_fs_info *fs_info, u64 *objec
}
static int btrfs_fill_super(struct super_block *sb,
- struct btrfs_fs_devices *fs_devices,
void *data)
{
struct inode *inode;
@@ -1458,7 +1457,7 @@ static int btrfs_fill_super(struct super_block *sb,
return err;
}
- err = open_ctree(sb, fs_devices, (char *)data);
+ err = open_ctree(sb, (char *)data);
if (err) {
btrfs_err(fs_info, "open_ctree failed");
return err;
@@ -1826,7 +1825,7 @@ static struct dentry *btrfs_mount_root(struct file_system_type *fs_type,
btrfs_sb(s)->bdev_holder = fs_type;
if (!strstr(crc32c_impl(), "generic"))
set_bit(BTRFS_FS_CSUM_IMPL_FAST, &fs_info->flags);
- error = btrfs_fill_super(s, fs_devices, data);
+ error = btrfs_fill_super(s, data);
}
if (!error)
error = security_sb_set_mnt_opts(s, new_sec_opts, 0, NULL);
At the timing of open_ctree(), we have already initialized fs_info->fs_devics, thus no need to pass a dedicated @fs_devices argument into open_ctree(). Signed-off-by: Qu Wenruo <wqu@suse.com> --- fs/btrfs/disk-io.c | 7 +++++-- fs/btrfs/disk-io.h | 4 +--- fs/btrfs/super.c | 5 ++--- 3 files changed, 8 insertions(+), 8 deletions(-)