btrfs: convert btrfs_inc_block_group_ro to accept fs_info
authorJeff Mahoney <jeffm@suse.com>
Wed, 15 Feb 2017 21:28:29 +0000 (16:28 -0500)
committerDavid Sterba <dsterba@suse.com>
Fri, 17 Feb 2017 11:03:56 +0000 (12:03 +0100)
btrfs_inc_block_group_ro is either passed the extent root or the dev
root, but it doesn't do anything with the dev tree.  Let's convert
to passing an fs_info and using the extent root.

Signed-off-by: Jeff Mahoney <jeffm@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 e7dbda3dd3b8dcf71a86ce730b45fc486ea22c93..7455a3e032cf7f441649c29c8a7c9124e9b0f5e2 100644 (file)
@@ -2729,7 +2729,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_root *root,
+int btrfs_inc_block_group_ro(struct btrfs_fs_info *fs_info,
                             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);
index 72727a805cb9500baf35a9d72795ed52358acbc9..24d6adcecdded00e1baf7d7b28284d3db0a8a396 100644 (file)
@@ -9359,17 +9359,16 @@ out:
        return ret;
 }
 
-int btrfs_inc_block_group_ro(struct btrfs_root *root,
+int btrfs_inc_block_group_ro(struct btrfs_fs_info *fs_info,
                             struct btrfs_block_group_cache *cache)
 
 {
-       struct btrfs_fs_info *fs_info = root->fs_info;
        struct btrfs_trans_handle *trans;
        u64 alloc_flags;
        int ret;
 
 again:
-       trans = btrfs_join_transaction(root);
+       trans = btrfs_join_transaction(fs_info->extent_root);
        if (IS_ERR(trans))
                return PTR_ERR(trans);
 
index 37175ace7fae2b74681bf926b796a136ccf959a2..e2cf65cd8f17f381363a50715bdeaa0a68c22fcc 100644 (file)
@@ -4334,7 +4334,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(extent_root, rc->block_group);
+       ret = btrfs_inc_block_group_ro(fs_info, rc->block_group);
        if (ret) {
                err = ret;
                goto out;
index f7dffacf61fa8c3a8cd37a55fb794e5c7d1a9ef2..ff9a11c39f5e1d88f699e549401878b360775265 100644 (file)
@@ -3582,7 +3582,7 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx,
                 * -> btrfs_scrub_pause()
                 */
                scrub_pause_on(fs_info);
-               ret = btrfs_inc_block_group_ro(root, cache);
+               ret = btrfs_inc_block_group_ro(fs_info, cache);
                if (!ret && is_dev_replace) {
                        /*
                         * If we are doing a device replace wait for any tasks