btrfs: push btrfs_grab_fs_root into btrfs_get_fs_root

Now that all callers of btrfs_get_fs_root are subsequently calling
btrfs_grab_fs_root and handling dropping the ref when they are done
appropriately, go ahead and push btrfs_grab_fs_root up into
btrfs_get_fs_root.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Josef Bacik 2020-01-24 09:32:56 -05:00 committed by David Sterba
parent 81f096edf0
commit bc44d7c4b2
14 changed files with 27 additions and 106 deletions

View file

@ -5158,10 +5158,6 @@ static int fixup_tree_root_location(struct btrfs_fs_info *fs_info,
err = PTR_ERR(new_root);
goto out;
}
if (!btrfs_grab_fs_root(new_root)) {
err = -ENOENT;
goto out;
}
*sub_root = new_root;
location->objectid = btrfs_root_dirid(&new_root->root_item);