diff options
author | Josef Bacik <josef@toxicpanda.com> | 2020-01-24 15:32:56 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-03-23 17:01:32 +0100 |
commit | bc44d7c4b2b179c4b74fba208b9908e2ecbc1b4d (patch) | |
tree | 183d1adc1dcae85af965e25476a5a6c8cbb0137b /fs/btrfs/relocation.c | |
parent | btrfs: use btrfs_put_fs_root to free roots always (diff) | |
download | linux-bc44d7c4b2b179c4b74fba208b9908e2ecbc1b4d.tar.xz linux-bc44d7c4b2b179c4b74fba208b9908e2ecbc1b4d.zip |
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>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r-- | fs/btrfs/relocation.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 440b662c3b0b..360f347d7524 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -659,7 +659,6 @@ static struct btrfs_root *read_fs_root(struct btrfs_fs_info *fs_info, u64 root_objectid) { struct btrfs_key key; - struct btrfs_root *root; key.objectid = root_objectid; key.type = BTRFS_ROOT_ITEM_KEY; @@ -668,12 +667,7 @@ static struct btrfs_root *read_fs_root(struct btrfs_fs_info *fs_info, else key.offset = (u64)-1; - root = btrfs_get_fs_root(fs_info, &key, false); - if (IS_ERR(root)) - return root; - if (!btrfs_grab_fs_root(root)) - return ERR_PTR(-ENOENT); - return root; + return btrfs_get_fs_root(fs_info, &key, false); } static noinline_for_stack |