btrfs: Remove fs_info argument from add_to_free_space_tree
authorNikolay Borisov <nborisov@suse.com>
Thu, 10 May 2018 12:44:55 +0000 (15:44 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 May 2018 16:07:36 +0000 (18:07 +0200)
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: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c
fs/btrfs/free-space-tree.c
fs/btrfs/free-space-tree.h

index 70f6dc7ca010623543aa914ee77541f03f17acd2..5be54cedb56f1d8481db9d8e7d97d40ab524797f 100644 (file)
@@ -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) {
                        btrfs_abort_transaction(trans, ret);
                        goto out;
index 36da2c3a28f677dbbc080b37320e65759cfa0706..494ff0815988d122c64e92d63278833768178787 100644 (file)
@@ -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,
-                          struct btrfs_fs_info *fs_info,
                           u64 start, u64 size)
 {
        struct btrfs_block_group_cache *block_group;
        struct btrfs_path *path;
        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;
 
        path = btrfs_alloc_path();
@@ -1015,7 +1014,7 @@ int add_to_free_space_tree(struct btrfs_trans_handle *trans,
                goto out;
        }
 
-       block_group = btrfs_lookup_block_group(fs_info, start);
+       block_group = btrfs_lookup_block_group(trans->fs_info, start);
        if (!block_group) {
                ASSERT(0);
                ret = -ENOENT;
index 95916320abecb3d5721a7a57fa08d8689afd6d37..3133651d7d706acf0214cae98408604cb888c96a 100644 (file)
@@ -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,
                                  struct btrfs_block_group_cache *block_group);
 int add_to_free_space_tree(struct btrfs_trans_handle *trans,
-                          struct btrfs_fs_info *fs_info,
                           u64 start, u64 size);
 int remove_from_free_space_tree(struct btrfs_trans_handle *trans,
                                u64 start, u64 size);