btrfs: Remove chunk_objectid argument from btrfs_make_block_group
btrfs_make_block_group is always called with chunk_objectid set to BTRFS_FIRST_CHUNK_TREE_OBJECTID. There's no reason why this behavior will change anytime soon, so let's remove the argument and decrease the cognitive load when reading the code path. No functional change Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
committed by
David Sterba
parent
0dde10bed2
commit
0174484d61
@@ -2676,8 +2676,7 @@ int btrfs_read_block_groups(struct btrfs_fs_info *info);
|
|||||||
int btrfs_can_relocate(struct btrfs_fs_info *fs_info, u64 bytenr);
|
int btrfs_can_relocate(struct btrfs_fs_info *fs_info, u64 bytenr);
|
||||||
int btrfs_make_block_group(struct btrfs_trans_handle *trans,
|
int btrfs_make_block_group(struct btrfs_trans_handle *trans,
|
||||||
struct btrfs_fs_info *fs_info, u64 bytes_used,
|
struct btrfs_fs_info *fs_info, u64 bytes_used,
|
||||||
u64 type, u64 chunk_objectid, u64 chunk_offset,
|
u64 type, u64 chunk_offset, u64 size);
|
||||||
u64 size);
|
|
||||||
struct btrfs_trans_handle *btrfs_start_trans_remove_block_group(
|
struct btrfs_trans_handle *btrfs_start_trans_remove_block_group(
|
||||||
struct btrfs_fs_info *fs_info,
|
struct btrfs_fs_info *fs_info,
|
||||||
const u64 chunk_offset);
|
const u64 chunk_offset);
|
||||||
|
|||||||
@@ -10180,8 +10180,7 @@ next:
|
|||||||
|
|
||||||
int btrfs_make_block_group(struct btrfs_trans_handle *trans,
|
int btrfs_make_block_group(struct btrfs_trans_handle *trans,
|
||||||
struct btrfs_fs_info *fs_info, u64 bytes_used,
|
struct btrfs_fs_info *fs_info, u64 bytes_used,
|
||||||
u64 type, u64 chunk_objectid, u64 chunk_offset,
|
u64 type, u64 chunk_offset, u64 size)
|
||||||
u64 size)
|
|
||||||
{
|
{
|
||||||
struct btrfs_block_group_cache *cache;
|
struct btrfs_block_group_cache *cache;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -10193,7 +10192,8 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
btrfs_set_block_group_used(&cache->item, bytes_used);
|
btrfs_set_block_group_used(&cache->item, bytes_used);
|
||||||
btrfs_set_block_group_chunk_objectid(&cache->item, chunk_objectid);
|
btrfs_set_block_group_chunk_objectid(&cache->item,
|
||||||
|
BTRFS_FIRST_CHUNK_TREE_OBJECTID);
|
||||||
btrfs_set_block_group_flags(&cache->item, type);
|
btrfs_set_block_group_flags(&cache->item, type);
|
||||||
|
|
||||||
cache->flags = type;
|
cache->flags = type;
|
||||||
|
|||||||
@@ -4826,9 +4826,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = btrfs_make_block_group(trans, info, 0, type,
|
ret = btrfs_make_block_group(trans, info, 0, type, start, num_bytes);
|
||||||
BTRFS_FIRST_CHUNK_TREE_OBJECTID,
|
|
||||||
start, num_bytes);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
goto error_del_extent;
|
goto error_del_extent;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user