Btrfs: cleanup, btrfs_read_fs_root_no_name() doesn't return NULL
authorStefan Behrens <sbehrens@giantdisaster.de>
Mon, 13 May 2013 14:42:57 +0000 (14:42 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Fri, 14 Jun 2013 15:29:29 +0000 (11:29 -0400)
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>
fs/btrfs/disk-io.c
fs/btrfs/send.c

index df5169b7aad1269c6fbf1f5a836495236db2b89e..bc2ea9b53048349911561f765d5976490c8103b7 100644 (file)
@@ -2821,8 +2821,6 @@ retry_root_backup:
        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;
index fedec7ba3537471481c0b8e17d4a2d91a986494d..dc43fed3f4bbdfd2ef4c3ccf768e36693ad37bf6 100644 (file)
@@ -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;
@@ -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;
                }
        }