btrfs: Remove fs_info from btrfs_inc_block_group_ro
authorNikolay Borisov <nborisov@suse.com>
Wed, 20 Jun 2018 12:49:14 +0000 (15:49 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:12:37 +0000 (13:12 +0200)
It can be referenced from the passed bg cache.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/relocation.c
fs/btrfs/scrub.c

index bc4bb275e339792a72c8ee29ed33bc553e212fe9..5bb083de8f2c663ed42d9d63e55811851a1eb819 100644 (file)
@@ -2801,8 +2801,7 @@ int btrfs_cond_migrate_bytes(struct btrfs_fs_info *fs_info,
 void btrfs_block_rsv_release(struct btrfs_fs_info *fs_info,
                             struct btrfs_block_rsv *block_rsv,
                             u64 num_bytes);
-int btrfs_inc_block_group_ro(struct btrfs_fs_info *fs_info,
-                            struct btrfs_block_group_cache *cache);
+int btrfs_inc_block_group_ro(struct btrfs_block_group_cache *cache);
 void btrfs_dec_block_group_ro(struct btrfs_block_group_cache *cache);
 void btrfs_put_block_group_cache(struct btrfs_fs_info *info);
 u64 btrfs_account_ro_block_groups_free_space(struct btrfs_space_info *sinfo);
index c27215dc8b840538bd04b5e29cc516b54affa77c..5e15b0c319f532aa65c455c56eb7fe2662f8d40c 100644 (file)
@@ -9426,10 +9426,10 @@ out:
        return ret;
 }
 
-int btrfs_inc_block_group_ro(struct btrfs_fs_info *fs_info,
-                            struct btrfs_block_group_cache *cache)
+int btrfs_inc_block_group_ro(struct btrfs_block_group_cache *cache)
 
 {
+       struct btrfs_fs_info *fs_info = cache->fs_info;
        struct btrfs_trans_handle *trans;
        u64 alloc_flags;
        int ret;
index 879b76fa881a5a6ded712dac891bd34d60ffdc18..ef1b5aad035e29d65dbc50744936c3f9d252dea6 100644 (file)
@@ -4375,7 +4375,7 @@ int btrfs_relocate_block_group(struct btrfs_fs_info *fs_info, u64 group_start)
        rc->block_group = btrfs_lookup_block_group(fs_info, group_start);
        BUG_ON(!rc->block_group);
 
-       ret = btrfs_inc_block_group_ro(fs_info, rc->block_group);
+       ret = btrfs_inc_block_group_ro(rc->block_group);
        if (ret) {
                err = ret;
                goto out;
index 5bce2330ec6483f69e57b9f18c5ecec76c67bb12..67bb003323e72c496558e516ce640ef67024abf3 100644 (file)
@@ -3832,7 +3832,7 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx,
                 * -> btrfs_scrub_pause()
                 */
                scrub_pause_on(fs_info);
-               ret = btrfs_inc_block_group_ro(fs_info, cache);
+               ret = btrfs_inc_block_group_ro(cache);
                if (!ret && is_dev_replace) {
                        /*
                         * If we are doing a device replace wait for any tasks