Commit 2d5cffa1 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 already takes a transaction handle which contains a
reference to fs_info.
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 9a7e0f92
...@@ -976,10 +976,10 @@ static int add_free_space_extent(struct btrfs_trans_handle *trans, ...@@ -976,10 +976,10 @@ static int add_free_space_extent(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,
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)
{ {
struct btrfs_fs_info *fs_info = trans->fs_info;
struct btrfs_free_space_info *info; struct btrfs_free_space_info *info;
u32 flags; u32 flags;
int ret; int ret;
...@@ -1030,8 +1030,7 @@ int add_to_free_space_tree(struct btrfs_trans_handle *trans, ...@@ -1030,8 +1030,7 @@ int add_to_free_space_tree(struct btrfs_trans_handle *trans,
} }
mutex_lock(&block_group->free_space_lock); mutex_lock(&block_group->free_space_lock);
ret = __add_to_free_space_tree(trans, fs_info, block_group, path, start, ret = __add_to_free_space_tree(trans, block_group, path, 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);
...@@ -1101,7 +1100,7 @@ static int populate_free_space_tree(struct btrfs_trans_handle *trans, ...@@ -1101,7 +1100,7 @@ static int populate_free_space_tree(struct btrfs_trans_handle *trans,
break; break;
if (start < key.objectid) { if (start < key.objectid) {
ret = __add_to_free_space_tree(trans, fs_info, ret = __add_to_free_space_tree(trans,
block_group, block_group,
path2, start, path2, start,
key.objectid - key.objectid -
...@@ -1126,8 +1125,8 @@ static int populate_free_space_tree(struct btrfs_trans_handle *trans, ...@@ -1126,8 +1125,8 @@ static int populate_free_space_tree(struct btrfs_trans_handle *trans,
break; break;
} }
if (start < end) { if (start < end) {
ret = __add_to_free_space_tree(trans, fs_info, block_group, ret = __add_to_free_space_tree(trans, block_group, path2,
path2, start, end - start); start, end - start);
if (ret) if (ret)
goto out_locked; goto out_locked;
} }
...@@ -1282,8 +1281,7 @@ static int __add_block_group_free_space(struct btrfs_trans_handle *trans, ...@@ -1282,8 +1281,7 @@ static int __add_block_group_free_space(struct btrfs_trans_handle *trans,
if (ret) if (ret)
return ret; return ret;
return __add_to_free_space_tree(trans, trans->fs_info, block_group, return __add_to_free_space_tree(trans, block_group, path,
path,
block_group->key.objectid, block_group->key.objectid,
block_group->key.offset); block_group->key.offset);
} }
......
...@@ -37,7 +37,6 @@ search_free_space_info(struct btrfs_trans_handle *trans, ...@@ -37,7 +37,6 @@ search_free_space_info(struct btrfs_trans_handle *trans,
struct btrfs_block_group_cache *block_group, struct btrfs_block_group_cache *block_group,
struct btrfs_path *path, int cow); struct btrfs_path *path, int cow);
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,
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,
......
...@@ -274,14 +274,14 @@ static int test_merge_left(struct btrfs_trans_handle *trans, ...@@ -274,14 +274,14 @@ static int test_merge_left(struct btrfs_trans_handle *trans,
return ret; return ret;
} }
ret = __add_to_free_space_tree(trans, fs_info, cache, path, ret = __add_to_free_space_tree(trans, cache, path, cache->key.objectid,
cache->key.objectid, alignment); alignment);
if (ret) { if (ret) {
test_msg("Could not add free space\n"); test_msg("Could not add free space\n");
return ret; return ret;
} }
ret = __add_to_free_space_tree(trans, fs_info, cache, path, ret = __add_to_free_space_tree(trans, cache, path,
cache->key.objectid + alignment, cache->key.objectid + alignment,
alignment); alignment);
if (ret) { if (ret) {
...@@ -312,7 +312,7 @@ static int test_merge_right(struct btrfs_trans_handle *trans, ...@@ -312,7 +312,7 @@ static int test_merge_right(struct btrfs_trans_handle *trans,
return ret; return ret;
} }
ret = __add_to_free_space_tree(trans, fs_info, cache, path, ret = __add_to_free_space_tree(trans, cache, path,
cache->key.objectid + 2 * alignment, cache->key.objectid + 2 * alignment,
alignment); alignment);
if (ret) { if (ret) {
...@@ -320,7 +320,7 @@ static int test_merge_right(struct btrfs_trans_handle *trans, ...@@ -320,7 +320,7 @@ static int test_merge_right(struct btrfs_trans_handle *trans,
return ret; return ret;
} }
ret = __add_to_free_space_tree(trans, fs_info, cache, path, ret = __add_to_free_space_tree(trans, cache, path,
cache->key.objectid + alignment, cache->key.objectid + alignment,
alignment); alignment);
if (ret) { if (ret) {
...@@ -351,14 +351,14 @@ static int test_merge_both(struct btrfs_trans_handle *trans, ...@@ -351,14 +351,14 @@ static int test_merge_both(struct btrfs_trans_handle *trans,
return ret; return ret;
} }
ret = __add_to_free_space_tree(trans, fs_info, cache, path, ret = __add_to_free_space_tree(trans, cache, path, cache->key.objectid,
cache->key.objectid, alignment); alignment);
if (ret) { if (ret) {
test_msg("Could not add free space\n"); test_msg("Could not add free space\n");
return ret; return ret;
} }
ret = __add_to_free_space_tree(trans, fs_info, cache, path, ret = __add_to_free_space_tree(trans, cache, path,
cache->key.objectid + 2 * alignment, cache->key.objectid + 2 * alignment,
alignment); alignment);
if (ret) { if (ret) {
...@@ -366,7 +366,7 @@ static int test_merge_both(struct btrfs_trans_handle *trans, ...@@ -366,7 +366,7 @@ static int test_merge_both(struct btrfs_trans_handle *trans,
return ret; return ret;
} }
ret = __add_to_free_space_tree(trans, fs_info, cache, path, ret = __add_to_free_space_tree(trans, cache, path,
cache->key.objectid + alignment, cache->key.objectid + alignment,
alignment); alignment);
if (ret) { if (ret) {
...@@ -399,14 +399,14 @@ static int test_merge_none(struct btrfs_trans_handle *trans, ...@@ -399,14 +399,14 @@ static int test_merge_none(struct btrfs_trans_handle *trans,
return ret; return ret;
} }
ret = __add_to_free_space_tree(trans, fs_info, cache, path, ret = __add_to_free_space_tree(trans, cache, path, cache->key.objectid,
cache->key.objectid, alignment); alignment);
if (ret) { if (ret) {
test_msg("Could not add free space\n"); test_msg("Could not add free space\n");
return ret; return ret;
} }
ret = __add_to_free_space_tree(trans, fs_info, cache, path, ret = __add_to_free_space_tree(trans, cache, path,
cache->key.objectid + 4 * alignment, cache->key.objectid + 4 * alignment,
alignment); alignment);
if (ret) { if (ret) {
...@@ -414,7 +414,7 @@ static int test_merge_none(struct btrfs_trans_handle *trans, ...@@ -414,7 +414,7 @@ static int test_merge_none(struct btrfs_trans_handle *trans,
return ret; return ret;
} }
ret = __add_to_free_space_tree(trans, fs_info, cache, path, ret = __add_to_free_space_tree(trans, cache, path,
cache->key.objectid + 2 * alignment, cache->key.objectid + 2 * alignment,
alignment); alignment);
if (ret) { if (ret) {
......
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