Skip to content

Commit 7eefae6

Browse files
josefbacikkdave
authored andcommitted
btrfs: pass btrfs_fs_info to btrfs_recover_relocation
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>
1 parent 33c4418 commit 7eefae6

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

fs/btrfs/ctree.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3833,7 +3833,7 @@ int btrfs_init_reloc_root(struct btrfs_trans_handle *trans,
38333833
struct btrfs_root *root);
38343834
int btrfs_update_reloc_root(struct btrfs_trans_handle *trans,
38353835
struct btrfs_root *root);
3836-
int btrfs_recover_relocation(struct btrfs_root *root);
3836+
int btrfs_recover_relocation(struct btrfs_fs_info *fs_info);
38373837
int btrfs_reloc_clone_csums(struct btrfs_inode *inode, u64 file_pos, u64 len);
38383838
int btrfs_reloc_cow_block(struct btrfs_trans_handle *trans,
38393839
struct btrfs_root *root, struct extent_buffer *buf,

fs/btrfs/disk-io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3379,7 +3379,7 @@ int btrfs_start_pre_rw_mount(struct btrfs_fs_info *fs_info)
33793379
up_read(&fs_info->cleanup_work_sem);
33803380

33813381
mutex_lock(&fs_info->cleaner_mutex);
3382-
ret = btrfs_recover_relocation(fs_info->tree_root);
3382+
ret = btrfs_recover_relocation(fs_info);
33833383
mutex_unlock(&fs_info->cleaner_mutex);
33843384
if (ret < 0) {
33853385
btrfs_warn(fs_info, "failed to recover relocation: %d", ret);

fs/btrfs/relocation.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4123,9 +4123,8 @@ static noinline_for_stack int mark_garbage_root(struct btrfs_root *root)
41234123
* this function resumes merging reloc trees with corresponding fs trees.
41244124
* this is important for keeping the sharing of tree blocks
41254125
*/
4126-
int btrfs_recover_relocation(struct btrfs_root *root)
4126+
int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
41274127
{
4128-
struct btrfs_fs_info *fs_info = root->fs_info;
41294128
LIST_HEAD(reloc_roots);
41304129
struct btrfs_key key;
41314130
struct btrfs_root *fs_root;
@@ -4166,7 +4165,7 @@ int btrfs_recover_relocation(struct btrfs_root *root)
41664165
key.type != BTRFS_ROOT_ITEM_KEY)
41674166
break;
41684167

4169-
reloc_root = btrfs_read_tree_root(root, &key);
4168+
reloc_root = btrfs_read_tree_root(fs_info->tree_root, &key);
41704169
if (IS_ERR(reloc_root)) {
41714170
err = PTR_ERR(reloc_root);
41724171
goto out;

0 commit comments

Comments
 (0)