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

btrfs: Remove fs_info argument from add_to_free_space_tree

This function takes a transaction handle which already contains a
reference to the fs_info. So use it and remove the extra function
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 25a356d3
...@@ -7127,7 +7127,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans, ...@@ -7127,7 +7127,7 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
} }
} }
ret = add_to_free_space_tree(trans, info, bytenr, num_bytes); ret = add_to_free_space_tree(trans, bytenr, num_bytes);
if (ret) { if (ret) {
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
goto out; goto out;
......
...@@ -999,14 +999,13 @@ int __add_to_free_space_tree(struct btrfs_trans_handle *trans, ...@@ -999,14 +999,13 @@ int __add_to_free_space_tree(struct btrfs_trans_handle *trans,
} }
int add_to_free_space_tree(struct btrfs_trans_handle *trans, int add_to_free_space_tree(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info,
u64 start, u64 size) u64 start, u64 size)
{ {
struct btrfs_block_group_cache *block_group; struct btrfs_block_group_cache *block_group;
struct btrfs_path *path; struct btrfs_path *path;
int ret; int ret;
if (!btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE)) if (!btrfs_fs_compat_ro(trans->fs_info, FREE_SPACE_TREE))
return 0; return 0;
path = btrfs_alloc_path(); path = btrfs_alloc_path();
...@@ -1015,7 +1014,7 @@ int add_to_free_space_tree(struct btrfs_trans_handle *trans, ...@@ -1015,7 +1014,7 @@ int add_to_free_space_tree(struct btrfs_trans_handle *trans,
goto out; goto out;
} }
block_group = btrfs_lookup_block_group(fs_info, start); block_group = btrfs_lookup_block_group(trans->fs_info, start);
if (!block_group) { if (!block_group) {
ASSERT(0); ASSERT(0);
ret = -ENOENT; ret = -ENOENT;
......
...@@ -23,7 +23,6 @@ int add_block_group_free_space(struct btrfs_trans_handle *trans, ...@@ -23,7 +23,6 @@ int add_block_group_free_space(struct btrfs_trans_handle *trans,
int remove_block_group_free_space(struct btrfs_trans_handle *trans, int remove_block_group_free_space(struct btrfs_trans_handle *trans,
struct btrfs_block_group_cache *block_group); struct btrfs_block_group_cache *block_group);
int add_to_free_space_tree(struct btrfs_trans_handle *trans, int add_to_free_space_tree(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info,
u64 start, u64 size); u64 start, u64 size);
int remove_from_free_space_tree(struct btrfs_trans_handle *trans, int remove_from_free_space_tree(struct btrfs_trans_handle *trans,
u64 start, u64 size); u64 start, u64 size);
......
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