btrfs: Remove fs_info argument from __remove_from_free_space_tree
authorNikolay Borisov <nborisov@suse.com>
Thu, 10 May 2018 12:44:53 +0000 (15:44 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 May 2018 16:07:35 +0000 (18:07 +0200)
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>
fs/btrfs/free-space-tree.c
fs/btrfs/free-space-tree.h
fs/btrfs/tests/free-space-tree-tests.c

index f0260cfcf7eba65149443ac5e4590dc8b06911fa..d9d464f0c72461490b9679e8136680ac67579331 100644 (file)
@@ -776,7 +776,6 @@ out:
 }
 
 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_path *path, u64 start, u64 size)
 {
@@ -790,7 +789,8 @@ int __remove_from_free_space_tree(struct btrfs_trans_handle *trans,
                        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))
                return PTR_ERR(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);
-       ret = __remove_from_free_space_tree(trans, fs_info, block_group, path,
-                                           start, size);
+       ret = __remove_from_free_space_tree(trans, block_group, path, start,
+                                           size);
        mutex_unlock(&block_group->free_space_lock);
 
        btrfs_put_block_group(block_group);
index 7624f2a1f8e759ae8b036ce966d671dfb4051617..ca3ad610a8d060a70d69f05121479480d2e363a4 100644 (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_path *path, u64 start, u64 size);
 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_path *path, u64 start, u64 size);
 int convert_free_space_to_bitmaps(struct btrfs_trans_handle *trans,
index 176ee997319c686638ed2c814749f90289cd9c91..cb92868eec15c10b69271595971a5562447ba957 100644 (file)
@@ -170,7 +170,7 @@ static int test_remove_all(struct btrfs_trans_handle *trans,
        const struct free_space_extent extents[] = {};
        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.offset);
        if (ret) {
@@ -194,7 +194,7 @@ static int test_remove_beginning(struct btrfs_trans_handle *trans,
        };
        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);
        if (ret) {
                test_msg("Could not remove free space\n");
@@ -217,7 +217,7 @@ static int test_remove_end(struct btrfs_trans_handle *trans,
        };
        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.offset - alignment,
                                            alignment);
@@ -243,7 +243,7 @@ static int test_remove_middle(struct btrfs_trans_handle *trans,
        };
        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,
                                            alignment);
        if (ret) {
@@ -266,7 +266,7 @@ static int test_merge_left(struct btrfs_trans_handle *trans,
        };
        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.offset);
        if (ret) {
@@ -304,7 +304,7 @@ static int test_merge_right(struct btrfs_trans_handle *trans,
        };
        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.offset);
        if (ret) {
@@ -343,7 +343,7 @@ static int test_merge_both(struct btrfs_trans_handle *trans,
        };
        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.offset);
        if (ret) {
@@ -391,7 +391,7 @@ static int test_merge_none(struct btrfs_trans_handle *trans,
        };
        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.offset);
        if (ret) {