btrfs: Remove fs_info argument from __remove_from_free_space_tree

This function takes a transaction handle which holds a reference to
fs_info. So use that and remove the extra argument.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Nikolay Borisov 2018-05-10 15:44:53 +03:00 committed by David Sterba
parent e581168d1f
commit c31683a6ef
3 changed files with 12 additions and 13 deletions

View File

@ -776,7 +776,6 @@ static int remove_free_space_extent(struct btrfs_trans_handle *trans,
} }
int __remove_from_free_space_tree(struct btrfs_trans_handle *trans, int __remove_from_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_path *path, u64 start, u64 size) struct btrfs_path *path, u64 start, u64 size)
{ {
@ -790,7 +789,8 @@ int __remove_from_free_space_tree(struct btrfs_trans_handle *trans,
return ret; return ret;
} }
info = search_free_space_info(NULL, fs_info, block_group, path, 0); info = search_free_space_info(NULL, trans->fs_info, block_group, path,
0);
if (IS_ERR(info)) if (IS_ERR(info))
return PTR_ERR(info); return PTR_ERR(info);
flags = btrfs_free_space_flags(path->nodes[0], info); flags = btrfs_free_space_flags(path->nodes[0], info);
@ -830,8 +830,8 @@ int remove_from_free_space_tree(struct btrfs_trans_handle *trans,
} }
mutex_lock(&block_group->free_space_lock); mutex_lock(&block_group->free_space_lock);
ret = __remove_from_free_space_tree(trans, fs_info, block_group, path, ret = __remove_from_free_space_tree(trans, block_group, path, start,
start, size); size);
mutex_unlock(&block_group->free_space_lock); mutex_unlock(&block_group->free_space_lock);
btrfs_put_block_group(block_group); btrfs_put_block_group(block_group);

View File

@ -39,7 +39,6 @@ int __add_to_free_space_tree(struct btrfs_trans_handle *trans,
struct btrfs_block_group_cache *block_group, struct btrfs_block_group_cache *block_group,
struct btrfs_path *path, u64 start, u64 size); struct btrfs_path *path, 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,
struct btrfs_fs_info *fs_info,
struct btrfs_block_group_cache *block_group, struct btrfs_block_group_cache *block_group,
struct btrfs_path *path, u64 start, u64 size); struct btrfs_path *path, u64 start, u64 size);
int convert_free_space_to_bitmaps(struct btrfs_trans_handle *trans, int convert_free_space_to_bitmaps(struct btrfs_trans_handle *trans,

View File

@ -170,7 +170,7 @@ static int test_remove_all(struct btrfs_trans_handle *trans,
const struct free_space_extent extents[] = {}; const struct free_space_extent extents[] = {};
int ret; int ret;
ret = __remove_from_free_space_tree(trans, fs_info, cache, path, ret = __remove_from_free_space_tree(trans, cache, path,
cache->key.objectid, cache->key.objectid,
cache->key.offset); cache->key.offset);
if (ret) { if (ret) {
@ -194,7 +194,7 @@ static int test_remove_beginning(struct btrfs_trans_handle *trans,
}; };
int ret; int ret;
ret = __remove_from_free_space_tree(trans, fs_info, cache, path, ret = __remove_from_free_space_tree(trans, cache, path,
cache->key.objectid, alignment); cache->key.objectid, alignment);
if (ret) { if (ret) {
test_msg("Could not remove free space\n"); test_msg("Could not remove free space\n");
@ -217,7 +217,7 @@ static int test_remove_end(struct btrfs_trans_handle *trans,
}; };
int ret; int ret;
ret = __remove_from_free_space_tree(trans, fs_info, cache, path, ret = __remove_from_free_space_tree(trans, cache, path,
cache->key.objectid + cache->key.objectid +
cache->key.offset - alignment, cache->key.offset - alignment,
alignment); alignment);
@ -243,7 +243,7 @@ static int test_remove_middle(struct btrfs_trans_handle *trans,
}; };
int ret; int ret;
ret = __remove_from_free_space_tree(trans, fs_info, cache, path, ret = __remove_from_free_space_tree(trans, cache, path,
cache->key.objectid + alignment, cache->key.objectid + alignment,
alignment); alignment);
if (ret) { if (ret) {
@ -266,7 +266,7 @@ static int test_merge_left(struct btrfs_trans_handle *trans,
}; };
int ret; int ret;
ret = __remove_from_free_space_tree(trans, fs_info, cache, path, ret = __remove_from_free_space_tree(trans, cache, path,
cache->key.objectid, cache->key.objectid,
cache->key.offset); cache->key.offset);
if (ret) { if (ret) {
@ -304,7 +304,7 @@ static int test_merge_right(struct btrfs_trans_handle *trans,
}; };
int ret; int ret;
ret = __remove_from_free_space_tree(trans, fs_info, cache, path, ret = __remove_from_free_space_tree(trans, cache, path,
cache->key.objectid, cache->key.objectid,
cache->key.offset); cache->key.offset);
if (ret) { if (ret) {
@ -343,7 +343,7 @@ static int test_merge_both(struct btrfs_trans_handle *trans,
}; };
int ret; int ret;
ret = __remove_from_free_space_tree(trans, fs_info, cache, path, ret = __remove_from_free_space_tree(trans, cache, path,
cache->key.objectid, cache->key.objectid,
cache->key.offset); cache->key.offset);
if (ret) { if (ret) {
@ -391,7 +391,7 @@ static int test_merge_none(struct btrfs_trans_handle *trans,
}; };
int ret; int ret;
ret = __remove_from_free_space_tree(trans, fs_info, cache, path, ret = __remove_from_free_space_tree(trans, cache, path,
cache->key.objectid, cache->key.objectid,
cache->key.offset); cache->key.offset);
if (ret) { if (ret) {