]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: pass btrfs_fs_info to btrfs_recover_relocation
authorJosef Bacik <josef@toxicpanda.com>
Fri, 18 Feb 2022 19:56:12 +0000 (14:56 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 14 Mar 2022 12:13:52 +0000 (13:13 +0100)
We don't need a root here, we just need the btrfs_fs_info, we can just
get the specific roots we need from fs_info.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/relocation.c

index 8e79e3ded8825364d04d97fe1e79e0f75f389e72..4db17bd05a21508258f7c053fb3b925e0ceb5876 100644 (file)
@@ -3833,7 +3833,7 @@ int btrfs_init_reloc_root(struct btrfs_trans_handle *trans,
                          struct btrfs_root *root);
 int btrfs_update_reloc_root(struct btrfs_trans_handle *trans,
                            struct btrfs_root *root);
-int btrfs_recover_relocation(struct btrfs_root *root);
+int btrfs_recover_relocation(struct btrfs_fs_info *fs_info);
 int btrfs_reloc_clone_csums(struct btrfs_inode *inode, u64 file_pos, u64 len);
 int btrfs_reloc_cow_block(struct btrfs_trans_handle *trans,
                          struct btrfs_root *root, struct extent_buffer *buf,
index 183baeffd9c9e05ba46b45b72797a74bad10e322..6a0b4dbd70e94771f4218eacd732776d2ba16ccb 100644 (file)
@@ -3379,7 +3379,7 @@ int btrfs_start_pre_rw_mount(struct btrfs_fs_info *fs_info)
        up_read(&fs_info->cleanup_work_sem);
 
        mutex_lock(&fs_info->cleaner_mutex);
-       ret = btrfs_recover_relocation(fs_info->tree_root);
+       ret = btrfs_recover_relocation(fs_info);
        mutex_unlock(&fs_info->cleaner_mutex);
        if (ret < 0) {
                btrfs_warn(fs_info, "failed to recover relocation: %d", ret);
index 50130f943d99900a675de1a9123d93ee35d6996c..df93c672f332bdcd3b6531e28b40c5fc91134454 100644 (file)
@@ -4123,9 +4123,8 @@ static noinline_for_stack int mark_garbage_root(struct btrfs_root *root)
  * this function resumes merging reloc trees with corresponding fs trees.
  * this is important for keeping the sharing of tree blocks
  */
-int btrfs_recover_relocation(struct btrfs_root *root)
+int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
 {
-       struct btrfs_fs_info *fs_info = root->fs_info;
        LIST_HEAD(reloc_roots);
        struct btrfs_key key;
        struct btrfs_root *fs_root;
@@ -4166,7 +4165,7 @@ int btrfs_recover_relocation(struct btrfs_root *root)
                    key.type != BTRFS_ROOT_ITEM_KEY)
                        break;
 
-               reloc_root = btrfs_read_tree_root(root, &key);
+               reloc_root = btrfs_read_tree_root(fs_info->tree_root, &key);
                if (IS_ERR(reloc_root)) {
                        err = PTR_ERR(reloc_root);
                        goto out;