Miao Xie
2010-Mar-25 12:36 UTC
[PATCH 15/18] btrfs: cleanup redundant code in btrfs_search_forward()
From: Miao Xie <miaox@cn.fujitsu.com> ret in btrfs_search_forward() has been set to 1, so it is unnecessary to set it to 1 again when some error happens. Cleanup these redundant code. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> --- fs/btrfs/ctree.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 4f258ba..e466add 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -3995,10 +3995,9 @@ again: path->nodes[level] = cur; path->locks[level] = 1; - if (btrfs_header_generation(cur) < min_trans) { - ret = 1; + if (btrfs_header_generation(cur) < min_trans) goto out; - } + while (1) { nritems = btrfs_header_nritems(cur); level = btrfs_header_level(cur); @@ -4037,10 +4036,8 @@ again: if (max_key) { btrfs_node_key(cur, &disk_key, slot); - if (comp_keys(&disk_key, max_key) >= 0) { - ret = 1; + if (comp_keys(&disk_key, max_key) >= 0) goto out; - } } tmp = btrfs_find_tree_block(root, blockptr, @@ -4067,9 +4064,8 @@ find_next_key: if (sret == 0) { btrfs_release_path(root, path); goto again; - } else { + } else goto out; - } } /* save our key for returning back */ btrfs_node_key_to_cpu(cur, &found_key, slot); -- 1.6.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html