btrfs: remove redundant variable from btrfs_cross_ref_exist
authorMisono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Thu, 30 Aug 2018 01:59:16 +0000 (10:59 +0900)
committerDavid Sterba <dsterba@suse.com>
Mon, 15 Oct 2018 15:23:29 +0000 (17:23 +0200)
Since commit d7df2c796d7e ("Btrfs attach delayed ref updates to delayed
ref heads"), check_delayed_ref() won't return -ENOENT.

In btrfs_cross_ref_exist(), two variables 'ret' and 'ret2' are
originally used to handle -ENOENT error case.  Since the code is not
needed anymore, let's just remove 'ret2'.

Signed-off-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c

index 9292e7c0ee81f8e8ff1fabc2eb46845204baa4ba..528f3308c32bd76af9e5de8053863b5931e08ac7 100644 (file)
@@ -3139,7 +3139,6 @@ int btrfs_cross_ref_exist(struct btrfs_root *root, u64 objectid, u64 offset,
 {
        struct btrfs_path *path;
        int ret;
-       int ret2;
 
        path = btrfs_alloc_path();
        if (!path)
@@ -3151,17 +3150,9 @@ int btrfs_cross_ref_exist(struct btrfs_root *root, u64 objectid, u64 offset,
                if (ret && ret != -ENOENT)
                        goto out;
 
-               ret2 = check_delayed_ref(root, path, objectid,
-                                        offset, bytenr);
-       } while (ret2 == -EAGAIN);
+               ret = check_delayed_ref(root, path, objectid, offset, bytenr);
+       } while (ret == -EAGAIN);
 
-       if (ret2 && ret2 != -ENOENT) {
-               ret = ret2;
-               goto out;
-       }
-
-       if (ret != -ENOENT || ret2 != -ENOENT)
-               ret = 0;
 out:
        btrfs_free_path(path);
        if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID)