From patchwork Wed Jul 18 15:50:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10532733 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 D110A600F4 for ; Wed, 18 Jul 2018 15:52:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF3F629972 for ; Wed, 18 Jul 2018 15:52:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B35F229980; Wed, 18 Jul 2018 15:52:19 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY 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 41A4229972 for ; Wed, 18 Jul 2018 15:52:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726181AbeGRQat (ORCPT ); Wed, 18 Jul 2018 12:30:49 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:37762 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730902AbeGRQat (ORCPT ); Wed, 18 Jul 2018 12:30:49 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6IFnkWH009065 for ; Wed, 18 Jul 2018 15:52:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=2a2Lkzj3/622lHw8dOmhk3bxYcuKoTISF7jbdauIsmA=; b=Ya6KRR+WLTWMGD+/fdDD7GQPc9Pfz7JnMA5BdnpRJqGeXdWaCr9cHsSOCBQCagDWsrth 77jfcHUnbIyYniHkuYLlmgyg+Y3YrE5wC9KJFljC9u/HsDL9QKXpftPl7j6doeDHwU6o 9vKlwgySa9jVW9rjuLOLjqoy3jiTH47WsjfdDm2pIpfWQ/wsVDTgALZweJniOwRXdisq 7smFvLCwpjL8MYUqhJC8iDCf/mML//VT/L6mBx68p1df2VAGWmxC0lV1/8Ln4NSwA5Ms RGUkWTQYBneZUbJPTNXuKfANfPBciKI1uFntya/lqJii502MN4+Vj/nqxff8Onv+Otrg 1A== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2k9yjgj8y1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Jul 2018 15:52:16 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w6IFqFbZ028293 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 18 Jul 2018 15:52:15 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w6IFpt0q007548 for ; Wed, 18 Jul 2018 15:52:07 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 18 Jul 2018 15:51:41 +0000 Subject: [PATCH 4/8] xfs: clean up xfs_btree_del_cursor callers From: "Darrick J. Wong" To: darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Wed, 18 Jul 2018 08:50:57 -0700 Message-ID: <153192905779.31685.9007503975897283723.stgit@magnolia> In-Reply-To: <153192902811.31685.11590100183112248407.stgit@magnolia> References: <153192902811.31685.11590100183112248407.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8958 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=3 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807180176 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Less trivial cleanups of the error argument to xfs_btree_del_cursor; these require some minor code refactoring. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Carlos Maiolino Reviewed-by: Christoph Hellwig --- fs/xfs/libxfs/xfs_refcount.c | 11 +++-------- fs/xfs/scrub/repair.c | 7 +++---- 2 files changed, 6 insertions(+), 12 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/xfs/libxfs/xfs_refcount.c b/fs/xfs/libxfs/xfs_refcount.c index 240a32984d13..a38e5840a73f 100644 --- a/fs/xfs/libxfs/xfs_refcount.c +++ b/fs/xfs/libxfs/xfs_refcount.c @@ -1675,11 +1675,11 @@ xfs_refcount_recover_cow_leftovers( high.rc.rc_startblock = -1U; error = xfs_btree_query_range(cur, &low, &high, xfs_refcount_recover_extent, &debris); - if (error) - goto out_cursor; - xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR); + xfs_btree_del_cursor(cur, error); xfs_trans_brelse(tp, agbp); xfs_trans_cancel(tp); + if (error) + goto out_free; /* Now iterate the list to free the leftovers */ list_for_each_entry_safe(rr, n, &debris, rr_list) { @@ -1727,11 +1727,6 @@ xfs_refcount_recover_cow_leftovers( kmem_free(rr); } return error; - -out_cursor: - xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); - xfs_trans_brelse(tp, agbp); - goto out_trans; } /* Is there a record covering a given extent? */ diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c index 35c589a04fac..ea39e2bdc96a 100644 --- a/fs/xfs/scrub/repair.c +++ b/fs/xfs/scrub/repair.c @@ -747,9 +747,9 @@ xfs_repair_dispose_btree_block( /* Can we find any other rmappings? */ error = xfs_rmap_has_other_keys(cur, agbno, 1, oinfo, &has_other_rmap); + xfs_btree_del_cursor(cur, error); if (error) - goto out_cur; - xfs_btree_del_cursor(cur, XFS_BTREE_NOERROR); + goto out_free; /* * If there are other rmappings, this block is cross linked and must @@ -779,8 +779,7 @@ xfs_repair_dispose_btree_block( return xfs_trans_roll_inode(&sc->tp, sc->ip); return xfs_repair_roll_ag_trans(sc); -out_cur: - xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); +out_free: if (agf_bp != sc->sa.agf_bp) xfs_trans_brelse(sc->tp, agf_bp); return error;