From patchwork Thu Jul 5 07:26:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhiyong Wu X-Patchwork-Id: 1158281 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id CE2E43FE4F for ; Thu, 5 Jul 2012 07:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753476Ab2GEH0w (ORCPT ); Thu, 5 Jul 2012 03:26:52 -0400 Received: from e31.co.us.ibm.com ([32.97.110.149]:50119 "EHLO e31.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753087Ab2GEH0v (ORCPT ); Thu, 5 Jul 2012 03:26:51 -0400 Received: from /spool/local by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Jul 2012 01:26:51 -0600 Received: from d01dlp03.pok.ibm.com (9.56.224.17) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 5 Jul 2012 01:26:49 -0600 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id C19BAC90050; Thu, 5 Jul 2012 03:26:48 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q657Qmi1357594; Thu, 5 Jul 2012 03:26:48 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q657QmxU022609; Thu, 5 Jul 2012 04:26:48 -0300 Received: from us.ibm.com (f15.cn.ibm.com [9.115.122.154]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id q657QjPp022510; Thu, 5 Jul 2012 04:26:46 -0300 Received: by us.ibm.com (sSMTP sendmail emulation); Thu, 5 Jul 2012 15:26:41 +0800 From: zwu.kernel@gmail.com To: linux-btrfs@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Zhi Yong Wu Subject: [PATCH] btrfs-progs: rework the code logic Date: Thu, 5 Jul 2012 15:26:38 +0800 Message-Id: <1341473198-3883-1-git-send-email-zwu.kernel@gmail.com> X-Mailer: git-send-email 1.7.6 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12070507-7282-0000-0000-00000A99E211 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org From: Zhi Yong Wu Signed-off-by: Zhi Yong Wu --- extent-cache.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extent-cache.c b/extent-cache.c index 3dd6434..a5084ee 100644 --- a/extent-cache.c +++ b/extent-cache.c @@ -136,10 +136,10 @@ struct cache_extent *find_first_cache_extent(struct cache_tree *tree, struct cache_extent *entry; ret = __tree_search(&tree->root, start, 1, &prev); - if (!ret) + if (!ret) { ret = prev; - if (!ret) return NULL; + } entry = rb_entry(ret, struct cache_extent, rb_node); return entry; }