Commit ffa9a9ef authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: Remove fs_info argument from populate_free_space_tree

This function always takes a transaction handle which contains a
reference to the fs_info. Use that and remove the extra argument.
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent e7355e50
...@@ -1039,10 +1039,9 @@ int add_to_free_space_tree(struct btrfs_trans_handle *trans, ...@@ -1039,10 +1039,9 @@ int add_to_free_space_tree(struct btrfs_trans_handle *trans,
* through the normal add/remove hooks. * through the normal add/remove hooks.
*/ */
static int populate_free_space_tree(struct btrfs_trans_handle *trans, static int populate_free_space_tree(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info,
struct btrfs_block_group_cache *block_group) struct btrfs_block_group_cache *block_group)
{ {
struct btrfs_root *extent_root = fs_info->extent_root; struct btrfs_root *extent_root = trans->fs_info->extent_root;
struct btrfs_path *path, *path2; struct btrfs_path *path, *path2;
struct btrfs_key key; struct btrfs_key key;
u64 start, end; u64 start, end;
...@@ -1102,7 +1101,7 @@ static int populate_free_space_tree(struct btrfs_trans_handle *trans, ...@@ -1102,7 +1101,7 @@ static int populate_free_space_tree(struct btrfs_trans_handle *trans,
} }
start = key.objectid; start = key.objectid;
if (key.type == BTRFS_METADATA_ITEM_KEY) if (key.type == BTRFS_METADATA_ITEM_KEY)
start += fs_info->nodesize; start += trans->fs_info->nodesize;
else else
start += key.offset; start += key.offset;
} else if (key.type == BTRFS_BLOCK_GROUP_ITEM_KEY) { } else if (key.type == BTRFS_BLOCK_GROUP_ITEM_KEY) {
...@@ -1158,7 +1157,7 @@ int btrfs_create_free_space_tree(struct btrfs_fs_info *fs_info) ...@@ -1158,7 +1157,7 @@ int btrfs_create_free_space_tree(struct btrfs_fs_info *fs_info)
while (node) { while (node) {
block_group = rb_entry(node, struct btrfs_block_group_cache, block_group = rb_entry(node, struct btrfs_block_group_cache,
cache_node); cache_node);
ret = populate_free_space_tree(trans, fs_info, block_group); ret = populate_free_space_tree(trans, block_group);
if (ret) if (ret)
goto abort; goto abort;
node = rb_next(node); node = rb_next(node);
......
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