Skip to content

Commit

Permalink
Btrfs: cleanup, btrfs_read_fs_root_no_name() doesn't return NULL
Browse files Browse the repository at this point in the history
No need to check for NULL in send.c and disk-io.c.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
  • Loading branch information
Stefan Behrens authored and Josef Bacik committed Jun 14, 2013
1 parent 78a1068 commit b1b1959
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 0 additions & 2 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2821,8 +2821,6 @@ int open_ctree(struct super_block *sb,
location.offset = (u64)-1;

fs_info->fs_root = btrfs_read_fs_root_no_name(fs_info, &location);
if (!fs_info->fs_root)
goto fail_qgroup;
if (IS_ERR(fs_info->fs_root)) {
err = PTR_ERR(fs_info->fs_root);
goto fail_qgroup;
Expand Down
8 changes: 2 additions & 6 deletions fs/btrfs/send.c
Original file line number Diff line number Diff line change
Expand Up @@ -4654,10 +4654,6 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
key.type = BTRFS_ROOT_ITEM_KEY;
key.offset = (u64)-1;
clone_root = btrfs_read_fs_root_no_name(fs_info, &key);
if (!clone_root) {
ret = -EINVAL;
goto out;
}
if (IS_ERR(clone_root)) {
ret = PTR_ERR(clone_root);
goto out;
Expand All @@ -4673,8 +4669,8 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
key.type = BTRFS_ROOT_ITEM_KEY;
key.offset = (u64)-1;
sctx->parent_root = btrfs_read_fs_root_no_name(fs_info, &key);
if (!sctx->parent_root) {
ret = -EINVAL;
if (IS_ERR(sctx->parent_root)) {
ret = PTR_ERR(sctx->parent_root);
goto out;
}
}
Expand Down

0 comments on commit b1b1959

Please sign in to comment.