From patchwork Thu Aug 30 01:59:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Misono Tomohiro X-Patchwork-Id: 10581123 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4FD905A4 for ; Thu, 30 Aug 2018 01:59:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DC722BA05 for ; Thu, 30 Aug 2018 01:59:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 326612BA0D; Thu, 30 Aug 2018 01:59:29 +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 93B192BA06 for ; Thu, 30 Aug 2018 01:59:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727088AbeH3F7J (ORCPT ); Thu, 30 Aug 2018 01:59:09 -0400 Received: from mgwym03.jp.fujitsu.com ([211.128.242.42]:40486 "EHLO mgwym03.jp.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725893AbeH3F7J (ORCPT ); Thu, 30 Aug 2018 01:59:09 -0400 Received: from yt-mxq.gw.nic.fujitsu.com (unknown [192.168.229.66]) by mgwym03.jp.fujitsu.com with smtp id 29a0_54e2_94b2411e_575b_4baf_bd11_6b5083f7f520; Thu, 30 Aug 2018 10:59:20 +0900 Received: from g01jpfmpwkw01.exch.g01.fujitsu.local (g01jpfmpwkw01.exch.g01.fujitsu.local [10.0.193.38]) by yt-mxq.gw.nic.fujitsu.com (Postfix) with ESMTP id 4903FAC0065 for ; Thu, 30 Aug 2018 10:59:20 +0900 (JST) Received: from G01JPEXCHKW18.g01.fujitsu.local (G01JPEXCHKW18.g01.fujitsu.local [10.0.194.57]) by g01jpfmpwkw01.exch.g01.fujitsu.local (Postfix) with ESMTP id 6E8CD692676 for ; Thu, 30 Aug 2018 10:59:19 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v2.5.2 X-SHieldMailCheckerPolicyVersion: FJ-ISEC-20170217-enc X-SHieldMailCheckerMailID: b8b528bfda80484a9758722452c8a9c1 From: Misono Tomohiro Subject: [PATCH] btrfs: extent-tree.c: Remove redundant variable from btrfs_cross_ref_exist() References: To: linux-btrfs Message-ID: <90c3c33c-0f7d-7121-feb8-4a74e5e78b93@jp.fujitsu.com> Date: Thu, 30 Aug 2018 10:59:16 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-SecurityPolicyCheck-GC: OK by FENCE-Mail X-TM-AS-MML: disable 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 commit d7df2c796d7e ("Btrfs attach delayed ref updates to delayed ref heads"), check_delaed_ref() won't return -ENOENT. In btrfs_cross_ref_exist(), two variable 'ret' and 'ret2' is originally used to handle -ENOENT error case. Since the code is not needed anymore, let's just remove 'ret2'. Signed-off-by: Misono Tomohiro --- fs/btrfs/extent-tree.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 2d9074295d7f..0c87472d5719 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3139,7 +3139,6 @@ int btrfs_cross_ref_exist(struct btrfs_root *root, u64 objectid, u64 offset, { struct btrfs_path *path; int ret; - int ret2; path = btrfs_alloc_path(); if (!path) @@ -3151,17 +3150,10 @@ int btrfs_cross_ref_exist(struct btrfs_root *root, u64 objectid, u64 offset, if (ret && ret != -ENOENT) goto out; - ret2 = check_delayed_ref(root, path, objectid, + ret = check_delayed_ref(root, path, objectid, offset, bytenr); - } while (ret2 == -EAGAIN); + } while (ret == -EAGAIN); - if (ret2 && ret2 != -ENOENT) { - ret = ret2; - goto out; - } - - if (ret != -ENOENT || ret2 != -ENOENT) - ret = 0; out: btrfs_free_path(path); if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID)