Commit 33a44f37 authored by Anand Jain's avatar Anand Jain Committed by David Sterba

btrfs: simplify return variables in btrfs_drop_subtree()

There's another return variable wret that is only passed to ret on
error, we can simply use ret.
Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 1618aa3c
...@@ -6099,7 +6099,6 @@ int btrfs_drop_subtree(struct btrfs_trans_handle *trans, ...@@ -6099,7 +6099,6 @@ int btrfs_drop_subtree(struct btrfs_trans_handle *trans,
int level; int level;
int parent_level; int parent_level;
int ret = 0; int ret = 0;
int wret;
BUG_ON(btrfs_root_id(root) != BTRFS_TREE_RELOC_OBJECTID); BUG_ON(btrfs_root_id(root) != BTRFS_TREE_RELOC_OBJECTID);
...@@ -6135,17 +6134,16 @@ int btrfs_drop_subtree(struct btrfs_trans_handle *trans, ...@@ -6135,17 +6134,16 @@ int btrfs_drop_subtree(struct btrfs_trans_handle *trans,
wc->reada_count = BTRFS_NODEPTRS_PER_BLOCK(fs_info); wc->reada_count = BTRFS_NODEPTRS_PER_BLOCK(fs_info);
while (1) { while (1) {
wret = walk_down_tree(trans, root, path, wc); ret = walk_down_tree(trans, root, path, wc);
if (wret < 0) { if (ret < 0)
ret = wret;
break; break;
}
wret = walk_up_tree(trans, root, path, wc, parent_level); ret = walk_up_tree(trans, root, path, wc, parent_level);
if (wret < 0) if (ret) {
ret = wret; if (ret > 0)
if (wret != 0) ret = 0;
break; break;
}
} }
kfree(wc); kfree(wc);
......
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