linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 15/18] btrfs: cleanup redundant code in btrfs_search_forward()
@ 2010-03-25 12:36 Miao Xie
  0 siblings, 0 replies; only message in thread
From: Miao Xie @ 2010-03-25 12:36 UTC (permalink / raw)
  To: Chris Mason; +Cc: Linux Btrfs

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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-25 12:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-25 12:36 [PATCH 15/18] btrfs: cleanup redundant code in btrfs_search_forward() Miao Xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).