Skip to content

Commit 3745bde

Browse files
fdmananakdave
authored andcommitted
btrfs: remove unnecessary fs_info argument from btrfs_add_block_group_cache()
The fs_info can be taken from the given block group, so there is no need to pass it as an argument. Also rename the local variable from 'info' to 'fs_info' which is more widely used, more clear and to be more consistent. Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 36a5e9b commit 3745bde

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

fs/btrfs/block-group.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,21 +191,21 @@ static int btrfs_bg_start_cmp(const struct rb_node *new,
191191
/*
192192
* This adds the block group to the fs_info rb tree for the block group cache
193193
*/
194-
static int btrfs_add_block_group_cache(struct btrfs_fs_info *info,
195-
struct btrfs_block_group *block_group)
194+
static int btrfs_add_block_group_cache(struct btrfs_block_group *block_group)
196195
{
196+
struct btrfs_fs_info *fs_info = block_group->fs_info;
197197
struct rb_node *exist;
198198
int ret = 0;
199199

200200
ASSERT(block_group->length != 0);
201201

202-
write_lock(&info->block_group_cache_lock);
202+
write_lock(&fs_info->block_group_cache_lock);
203203

204204
exist = rb_find_add_cached(&block_group->cache_node,
205-
&info->block_group_cache_tree, btrfs_bg_start_cmp);
205+
&fs_info->block_group_cache_tree, btrfs_bg_start_cmp);
206206
if (exist)
207207
ret = -EEXIST;
208-
write_unlock(&info->block_group_cache_lock);
208+
write_unlock(&fs_info->block_group_cache_lock);
209209

210210
return ret;
211211
}
@@ -2438,7 +2438,7 @@ static int read_one_block_group(struct btrfs_fs_info *info,
24382438
goto error;
24392439
}
24402440

2441-
ret = btrfs_add_block_group_cache(info, cache);
2441+
ret = btrfs_add_block_group_cache(cache);
24422442
if (ret) {
24432443
btrfs_remove_free_space_cache(cache);
24442444
goto error;
@@ -2487,7 +2487,7 @@ static int fill_dummy_bgs(struct btrfs_fs_info *fs_info)
24872487
bg->cached = BTRFS_CACHE_FINISHED;
24882488
bg->used = map->chunk_len;
24892489
bg->flags = map->type;
2490-
ret = btrfs_add_block_group_cache(fs_info, bg);
2490+
ret = btrfs_add_block_group_cache(bg);
24912491
/*
24922492
* We may have some valid block group cache added already, in
24932493
* that case we skip to the next one.
@@ -2914,7 +2914,7 @@ struct btrfs_block_group *btrfs_make_block_group(struct btrfs_trans_handle *tran
29142914
cache->space_info = btrfs_find_space_info(fs_info, cache->flags);
29152915
ASSERT(cache->space_info);
29162916

2917-
ret = btrfs_add_block_group_cache(fs_info, cache);
2917+
ret = btrfs_add_block_group_cache(cache);
29182918
if (ret) {
29192919
btrfs_remove_free_space_cache(cache);
29202920
btrfs_put_block_group(cache);

0 commit comments

Comments
 (0)