Commit 380fd066 authored by Misono Tomohiro's avatar Misono Tomohiro Committed by David Sterba

btrfs: remove redundant variable from btrfs_cross_ref_exist

Since commit d7df2c79 ("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: default avatarMisono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent e49aabd9
...@@ -3139,7 +3139,6 @@ int btrfs_cross_ref_exist(struct btrfs_root *root, u64 objectid, u64 offset, ...@@ -3139,7 +3139,6 @@ int btrfs_cross_ref_exist(struct btrfs_root *root, u64 objectid, u64 offset,
{ {
struct btrfs_path *path; struct btrfs_path *path;
int ret; int ret;
int ret2;
path = btrfs_alloc_path(); path = btrfs_alloc_path();
if (!path) if (!path)
...@@ -3151,17 +3150,9 @@ int btrfs_cross_ref_exist(struct btrfs_root *root, u64 objectid, u64 offset, ...@@ -3151,17 +3150,9 @@ int btrfs_cross_ref_exist(struct btrfs_root *root, u64 objectid, u64 offset,
if (ret && ret != -ENOENT) if (ret && ret != -ENOENT)
goto out; goto out;
ret2 = check_delayed_ref(root, path, objectid, ret = check_delayed_ref(root, path, objectid, offset, bytenr);
offset, bytenr); } while (ret == -EAGAIN);
} while (ret2 == -EAGAIN);
if (ret2 && ret2 != -ENOENT) {
ret = ret2;
goto out;
}
if (ret != -ENOENT || ret2 != -ENOENT)
ret = 0;
out: out:
btrfs_free_path(path); btrfs_free_path(path);
if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID) if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment