From patchwork Thu Mar 25 12:36:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miao Xie X-Patchwork-Id: 88220 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2PCaT4m031971 for ; Thu, 25 Mar 2010 12:36:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753063Ab0CYMg2 (ORCPT ); Thu, 25 Mar 2010 08:36:28 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:52445 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752677Ab0CYMg1 (ORCPT ); Thu, 25 Mar 2010 08:36:27 -0400 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id 62E6917003F; Thu, 25 Mar 2010 20:36:26 +0800 (CST) Received: from fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id o2PCZ7vK006056; Thu, 25 Mar 2010 20:35:07 +0800 Received: from [127.0.0.1] (unknown [10.167.141.211]) by fnst.cn.fujitsu.com (Postfix) with ESMTPA id 5A93CDC220; Thu, 25 Mar 2010 20:38:52 +0800 (CST) Message-ID: <4BAB58DA.90904@cn.fujitsu.com> Date: Thu, 25 Mar 2010 20:36:42 +0800 From: Miao Xie Reply-To: miaox@cn.fujitsu.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: Chris Mason CC: Linux Btrfs Subject: [PATCH 15/18] btrfs: cleanup redundant code in btrfs_search_forward() Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 25 Mar 2010 12:36:29 +0000 (UTC) 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);