@@ -150,9 +150,9 @@ void btrfs_put_block_group(struct btrfs_block_group *cache)
/*
* This adds the block group to the fs_info rb tree for the block group cache
*/
-static int btrfs_add_block_group_cache(struct btrfs_fs_info *info,
- struct btrfs_block_group *block_group)
+static int add_block_group(struct btrfs_block_group *block_group)
{
+ struct btrfs_fs_info *info = block_group->fs_info;
struct rb_node **p;
struct rb_node *parent = NULL;
struct btrfs_block_group *cache;
@@ -1966,7 +1966,7 @@ static int read_one_block_group(struct btrfs_fs_info *info,
btrfs_free_excluded_extents(cache);
}
- ret = btrfs_add_block_group_cache(info, cache);
+ ret = add_block_group(cache);
if (ret) {
btrfs_remove_free_space_cache(cache);
goto error;
@@ -2167,7 +2167,7 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans, u64 bytes_used,
cache->space_info = btrfs_find_space_info(fs_info, cache->flags);
ASSERT(cache->space_info);
- ret = btrfs_add_block_group_cache(fs_info, cache);
+ ret = add_block_group(cache);
if (ret) {
btrfs_remove_free_space_cache(cache);
btrfs_put_block_group(cache);
We can cleanup btrfs_add_block_group_cache() by: - Remove the "btrfs_" prefix Since it's not exported, and only used inside block-group.c - Remove the "_cache" suffix We have renamed struct btrfs_block_group_cache to btrfs_block_group, thus no need to keep the "_cache" suffix. - Sink the btrfs_fs_info parameter Since commit aac0023c2106 ("btrfs: move basic block_group definitions to their own header") we can grab btrfs_fs_info from struct btrfs_block_group directly. Signed-off-by: Qu Wenruo <wqu@suse.com> --- fs/btrfs/block-group.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)