提交 6fef8df1 编写于 作者: I Ilya Dryomov

Btrfs: get rid of *_alloc_profile fields

{data,metadata,system}_alloc_profile fields have been unused for a long
time now.  Get rid of them.
Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
上级 08c422c2
...@@ -1135,9 +1135,6 @@ struct btrfs_fs_info { ...@@ -1135,9 +1135,6 @@ struct btrfs_fs_info {
u64 avail_data_alloc_bits; u64 avail_data_alloc_bits;
u64 avail_metadata_alloc_bits; u64 avail_metadata_alloc_bits;
u64 avail_system_alloc_bits; u64 avail_system_alloc_bits;
u64 data_alloc_profile;
u64 metadata_alloc_profile;
u64 system_alloc_profile;
unsigned data_chunk_allocations; unsigned data_chunk_allocations;
unsigned metadata_ratio; unsigned metadata_ratio;
......
...@@ -2321,9 +2321,6 @@ struct btrfs_root *open_ctree(struct super_block *sb, ...@@ -2321,9 +2321,6 @@ struct btrfs_root *open_ctree(struct super_block *sb,
fs_info->generation = generation; fs_info->generation = generation;
fs_info->last_trans_committed = generation; fs_info->last_trans_committed = generation;
fs_info->data_alloc_profile = (u64)-1;
fs_info->metadata_alloc_profile = (u64)-1;
fs_info->system_alloc_profile = fs_info->metadata_alloc_profile;
ret = btrfs_init_space_info(fs_info); ret = btrfs_init_space_info(fs_info);
if (ret) { if (ret) {
......
...@@ -3067,14 +3067,12 @@ u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags) ...@@ -3067,14 +3067,12 @@ u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags)
static u64 get_alloc_profile(struct btrfs_root *root, u64 flags) static u64 get_alloc_profile(struct btrfs_root *root, u64 flags)
{ {
if (flags & BTRFS_BLOCK_GROUP_DATA) if (flags & BTRFS_BLOCK_GROUP_DATA)
flags |= root->fs_info->avail_data_alloc_bits & flags |= root->fs_info->avail_data_alloc_bits;
root->fs_info->data_alloc_profile;
else if (flags & BTRFS_BLOCK_GROUP_SYSTEM) else if (flags & BTRFS_BLOCK_GROUP_SYSTEM)
flags |= root->fs_info->avail_system_alloc_bits & flags |= root->fs_info->avail_system_alloc_bits;
root->fs_info->system_alloc_profile;
else if (flags & BTRFS_BLOCK_GROUP_METADATA) else if (flags & BTRFS_BLOCK_GROUP_METADATA)
flags |= root->fs_info->avail_metadata_alloc_bits & flags |= root->fs_info->avail_metadata_alloc_bits;
root->fs_info->metadata_alloc_profile;
return btrfs_reduce_alloc_profile(root, flags); return btrfs_reduce_alloc_profile(root, flags);
} }
......
...@@ -2752,8 +2752,7 @@ static noinline int init_first_rw_device(struct btrfs_trans_handle *trans, ...@@ -2752,8 +2752,7 @@ static noinline int init_first_rw_device(struct btrfs_trans_handle *trans,
return ret; return ret;
alloc_profile = BTRFS_BLOCK_GROUP_METADATA | alloc_profile = BTRFS_BLOCK_GROUP_METADATA |
(fs_info->metadata_alloc_profile & fs_info->avail_metadata_alloc_bits;
fs_info->avail_metadata_alloc_bits);
alloc_profile = btrfs_reduce_alloc_profile(root, alloc_profile); alloc_profile = btrfs_reduce_alloc_profile(root, alloc_profile);
ret = __btrfs_alloc_chunk(trans, extent_root, &map, &chunk_size, ret = __btrfs_alloc_chunk(trans, extent_root, &map, &chunk_size,
...@@ -2763,8 +2762,7 @@ static noinline int init_first_rw_device(struct btrfs_trans_handle *trans, ...@@ -2763,8 +2762,7 @@ static noinline int init_first_rw_device(struct btrfs_trans_handle *trans,
sys_chunk_offset = chunk_offset + chunk_size; sys_chunk_offset = chunk_offset + chunk_size;
alloc_profile = BTRFS_BLOCK_GROUP_SYSTEM | alloc_profile = BTRFS_BLOCK_GROUP_SYSTEM |
(fs_info->system_alloc_profile & fs_info->avail_system_alloc_bits;
fs_info->avail_system_alloc_bits);
alloc_profile = btrfs_reduce_alloc_profile(root, alloc_profile); alloc_profile = btrfs_reduce_alloc_profile(root, alloc_profile);
ret = __btrfs_alloc_chunk(trans, extent_root, &sys_map, ret = __btrfs_alloc_chunk(trans, extent_root, &sys_map,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册