From patchwork Mon May 21 09:32:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gu Jinxiang X-Patchwork-Id: 10414447 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 56AC96032C for ; Mon, 21 May 2018 09:32:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 489F328779 for ; Mon, 21 May 2018 09:32:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B552287C2; Mon, 21 May 2018 09:32:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BED9F28779 for ; Mon, 21 May 2018 09:32:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751244AbeEUJcq (ORCPT ); Mon, 21 May 2018 05:32:46 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:61830 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751027AbeEUJcq (ORCPT ); Mon, 21 May 2018 05:32:46 -0400 X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="40160725" Received: from localhost (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 21 May 2018 17:32:44 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id C2D214B40405 for ; Mon, 21 May 2018 17:32:41 +0800 (CST) Received: from ubuntu.g08.fujitsu.local (10.167.226.132) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.399.0; Mon, 21 May 2018 17:32:44 +0800 From: Gu Jinxiang To: Subject: [PATCH] btrfs: remove unnecessary if judge Date: Mon, 21 May 2018 17:32:14 +0800 Message-ID: <1526895134-1714-1-git-send-email-gujx@cn.fujitsu.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.167.226.132] X-yoursite-MailScanner-ID: C2D214B40405.A60AC X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: gujx@cn.fujitsu.com Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since add_excluded_extent always returns 0, no need to judge ret. Signed-off-by: Gu Jinxiang --- fs/btrfs/extent-tree.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 75cfb80d2551..4d876b32e136 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -249,8 +249,6 @@ static int exclude_super_stripes(struct btrfs_fs_info *fs_info, cache->bytes_super += stripe_len; ret = add_excluded_extent(fs_info, cache->key.objectid, stripe_len); - if (ret) - return ret; } for (i = 0; i < BTRFS_SUPER_MIRROR_MAX; i++) { @@ -282,10 +280,6 @@ static int exclude_super_stripes(struct btrfs_fs_info *fs_info, cache->bytes_super += len; ret = add_excluded_extent(fs_info, start, len); - if (ret) { - kfree(logical); - return ret; - } } kfree(logical);