summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2020-01-24 09:32:56 -0500
committerDavid Sterba <dsterba@suse.com>2020-03-23 17:01:32 +0100
commitbc44d7c4b2b179c4b74fba208b9908e2ecbc1b4d (patch)
tree183d1adc1dcae85af965e25476a5a6c8cbb0137b /fs/btrfs/ioctl.c
parent81f096edf0472864879e1e5a7f0fdf87ea90fe75 (diff)
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/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index f36aa0674ade..bb8106f7dd26 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -672,11 +672,6 @@ static noinline int create_subvol(struct inode *dir,
btrfs_abort_transaction(trans, ret);
goto fail;
}
- if (!btrfs_grab_fs_root(new_root)) {
- ret = -ENOENT;
- btrfs_abort_transaction(trans, ret);
- goto fail;
- }
btrfs_record_root_in_trans(trans, new_root);
@@ -2191,10 +2186,6 @@ static noinline int search_ioctl(struct inode *inode,
btrfs_free_path(path);
return PTR_ERR(root);
}
- if (!btrfs_grab_fs_root(root)) {
- btrfs_free_path(path);
- return -ENOENT;
- }
}
key.objectid = sk->min_objectid;
@@ -2332,11 +2323,6 @@ static noinline int btrfs_search_path_in_tree(struct btrfs_fs_info *info,
root = NULL;
goto out;
}
- if (!btrfs_grab_fs_root(root)) {
- ret = -ENOENT;
- root = NULL;
- goto out;
- }
key.objectid = dirid;
key.type = BTRFS_INODE_REF_KEY;
@@ -2432,10 +2418,6 @@ static int btrfs_search_path_in_tree_user(struct inode *inode,
ret = PTR_ERR(root);
goto out;
}
- if (!btrfs_grab_fs_root(root)) {
- ret = -ENOENT;
- goto out;
- }
key.objectid = dirid;
key.type = BTRFS_INODE_REF_KEY;
@@ -2684,10 +2666,6 @@ static int btrfs_ioctl_get_subvol_info(struct file *file, void __user *argp)
ret = PTR_ERR(root);
goto out_free;
}
- if (!btrfs_grab_fs_root(root)) {
- ret = -ENOENT;
- goto out;
- }
root_item = &root->root_item;
subvol_info->treeid = key.objectid;
@@ -4018,10 +3996,6 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
ret = PTR_ERR(new_root);
goto out;
}
- if (!btrfs_grab_fs_root(new_root)) {
- ret = -ENOENT;
- goto out;
- }
if (!is_fstree(new_root->root_key.objectid)) {
ret = -ENOENT;
goto out_free;