Commit 4ca61683 authored by Lu Fengqi's avatar Lu Fengqi Committed by David Sterba

btrfs: drop unused space_info parameter from create_space_info

Since commit dc2d3005 ("btrfs: remove dead create_space_info
calls"), there is only one caller btrfs_init_space_info. However, it
doesn't need create_space_info to return space_info at all.
Signed-off-by: default avatarLu Fengqi <lufq.fnst@cn.fujitsu.com>
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent ff76a864
...@@ -4007,8 +4007,7 @@ static const char *alloc_name(u64 flags) ...@@ -4007,8 +4007,7 @@ static const char *alloc_name(u64 flags)
}; };
} }
static int create_space_info(struct btrfs_fs_info *info, u64 flags, static int create_space_info(struct btrfs_fs_info *info, u64 flags)
struct btrfs_space_info **new)
{ {
struct btrfs_space_info *space_info; struct btrfs_space_info *space_info;
...@@ -4046,7 +4045,6 @@ static int create_space_info(struct btrfs_fs_info *info, u64 flags, ...@@ -4046,7 +4045,6 @@ static int create_space_info(struct btrfs_fs_info *info, u64 flags,
return ret; return ret;
} }
*new = space_info;
list_add_rcu(&space_info->list, &info->space_info); list_add_rcu(&space_info->list, &info->space_info);
if (flags & BTRFS_BLOCK_GROUP_DATA) if (flags & BTRFS_BLOCK_GROUP_DATA)
info->data_sinfo = space_info; info->data_sinfo = space_info;
...@@ -10825,7 +10823,6 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info) ...@@ -10825,7 +10823,6 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info)
int btrfs_init_space_info(struct btrfs_fs_info *fs_info) int btrfs_init_space_info(struct btrfs_fs_info *fs_info)
{ {
struct btrfs_space_info *space_info;
struct btrfs_super_block *disk_super; struct btrfs_super_block *disk_super;
u64 features; u64 features;
u64 flags; u64 flags;
...@@ -10841,21 +10838,21 @@ int btrfs_init_space_info(struct btrfs_fs_info *fs_info) ...@@ -10841,21 +10838,21 @@ int btrfs_init_space_info(struct btrfs_fs_info *fs_info)
mixed = 1; mixed = 1;
flags = BTRFS_BLOCK_GROUP_SYSTEM; flags = BTRFS_BLOCK_GROUP_SYSTEM;
ret = create_space_info(fs_info, flags, &space_info); ret = create_space_info(fs_info, flags);
if (ret) if (ret)
goto out; goto out;
if (mixed) { if (mixed) {
flags = BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_DATA; flags = BTRFS_BLOCK_GROUP_METADATA | BTRFS_BLOCK_GROUP_DATA;
ret = create_space_info(fs_info, flags, &space_info); ret = create_space_info(fs_info, flags);
} else { } else {
flags = BTRFS_BLOCK_GROUP_METADATA; flags = BTRFS_BLOCK_GROUP_METADATA;
ret = create_space_info(fs_info, flags, &space_info); ret = create_space_info(fs_info, flags);
if (ret) if (ret)
goto out; goto out;
flags = BTRFS_BLOCK_GROUP_DATA; flags = BTRFS_BLOCK_GROUP_DATA;
ret = create_space_info(fs_info, flags, &space_info); ret = create_space_info(fs_info, flags);
} }
out: out:
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment