From patchwork Mon Oct 1 17:04:58 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: 10622447 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 CA01413BB for ; Mon, 1 Oct 2018 17:05:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3B72212D8 for ; Mon, 1 Oct 2018 17:05:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A819221C9A; Mon, 1 Oct 2018 17:05:12 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, 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 EC1D1212D8 for ; Mon, 1 Oct 2018 17:05:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725906AbeJAXnt (ORCPT ); Mon, 1 Oct 2018 19:43:49 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:49430 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725740AbeJAXnt (ORCPT ); Mon, 1 Oct 2018 19:43:49 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w91H3wMC157452; Mon, 1 Oct 2018 17:05:01 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=hwnBRTAhxHTqi0tycXTq9k6anoq+Aer/VgxXbnKwxyk=; b=rCbEu2qI93eaHhREpFmMQWuVbkwye5KCdxhllF40qW9/W8AObB1g0hlDEjSfJuIXCDcj SlixO8afPVny0eTHi7DihTgCUAwu7WBTqcpDrYi+gMJBXM2DBVT+sLpffgfjpNkqFC8y 7bXLX1qZnbmFSxY2GREWZm+1ERXRWw7+4dpfETAEmnzVTj4221mgBDeTCaGZAKOsE7h4 s9Dcvywft8BsjoYJCV5bL4itmImr0S/BRNdH3Bbt1sg4TwDpH+aVsVv9njB6qIPQ9wNA wo4af3DPE3bQkSs991QK/RZjeEOwcM/mETsmYOw2EqsrX3OO0kwHgaeg0O3LpLVOIrrL 7A== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2mt21qrmbg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 01 Oct 2018 17:05:01 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w91H50l1018419 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 1 Oct 2018 17:05:00 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w91H50vd025957; Mon, 1 Oct 2018 17:05:00 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 01 Oct 2018 10:04:59 -0700 Subject: [PATCH 6/8] libxfs: clean up IRELE/iput callsites From: "Darrick J. Wong" To: sandeen@redhat.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Mon, 01 Oct 2018 10:04:58 -0700 Message-ID: <153841349888.27952.10960138712287407315.stgit@magnolia> In-Reply-To: <153841345236.27952.5050172703525712660.stgit@magnolia> References: <153841345236.27952.5050172703525712660.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9033 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 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-1807170000 definitions=main-1810010163 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 Replace the IRELE macro with a proper function so that we can do proper typechecking. This is the userspace cleanup in the same vein as the kernel patch with the same subject. --- db/attrset.c | 4 ++-- include/xfs_inode.h | 4 +--- libxfs/init.c | 4 ++-- libxfs/rdwr.c | 5 +++-- mkfs/proto.c | 6 +++--- repair/phase6.c | 22 +++++++++++----------- repair/phase7.c | 2 +- 7 files changed, 23 insertions(+), 24 deletions(-) diff --git a/db/attrset.c b/db/attrset.c index dc82a6c6..56972506 100644 --- a/db/attrset.c +++ b/db/attrset.c @@ -159,7 +159,7 @@ attr_set_f( out: mp->m_flags &= ~LIBXFS_MOUNT_COMPAT_ATTR; if (ip) - IRELE(ip); + libxfs_irele(ip); if (value) free(value); return 0; @@ -234,6 +234,6 @@ attr_remove_f( out: mp->m_flags &= ~LIBXFS_MOUNT_COMPAT_ATTR; if (ip) - IRELE(ip); + libxfs_irele(ip); return 0; } diff --git a/include/xfs_inode.h b/include/xfs_inode.h index f573f23b..79ec3a2d 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -155,8 +155,6 @@ extern bool libxfs_inode_verify_forks(struct xfs_inode *ip, extern int libxfs_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, uint, struct xfs_inode **, struct xfs_ifork_ops *); -extern void libxfs_iput(struct xfs_inode *); - -#define IRELE(ip) libxfs_iput(ip) +extern void libxfs_irele(struct xfs_inode *ip); #endif /* __XFS_INODE_H__ */ diff --git a/libxfs/init.c b/libxfs/init.c index 36d637c5..d7543d4a 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -838,9 +838,9 @@ void libxfs_rtmount_destroy(xfs_mount_t *mp) { if (mp->m_rsumip) - IRELE(mp->m_rsumip); + libxfs_irele(mp->m_rsumip); if (mp->m_rbmip) - IRELE(mp->m_rbmip); + libxfs_irele(mp->m_rbmip); mp->m_rsumip = mp->m_rbmip = NULL; } diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index 14a4633e..0ee3ba86 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -1402,7 +1402,7 @@ libxfs_iget( } if (!libxfs_inode_verify_forks(ip, ifork_ops)) { - libxfs_iput(ip); + libxfs_irele(ip); return -EFSCORRUPTED; } @@ -1435,7 +1435,8 @@ libxfs_idestroy(xfs_inode_t *ip) } void -libxfs_iput(xfs_inode_t *ip) +libxfs_irele( + struct xfs_inode *ip) { if (ip->i_itemp) kmem_zone_free(xfs_ili_zone, ip->i_itemp); diff --git a/mkfs/proto.c b/mkfs/proto.c index dc82f093..687c53ab 100644 --- a/mkfs/proto.c +++ b/mkfs/proto.c @@ -479,7 +479,7 @@ parseproto( if (error) fail(_("Space preallocation failed."), error); rsvfile(mp, ip, llen); - IRELE(ip); + libxfs_irele(ip); return; case IF_BLOCK: @@ -573,7 +573,7 @@ parseproto( break; parseproto(mp, ip, fsxp, pp, name); } - IRELE(ip); + libxfs_irele(ip); return; default: ASSERT(0); @@ -585,7 +585,7 @@ parseproto( fail(_("Error encountered creating file from prototype file"), error); } - IRELE(ip); + libxfs_irele(ip); } void diff --git a/repair/phase6.c b/repair/phase6.c index 8c0165ca..e2e4446a 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -612,7 +612,7 @@ mk_rbmino(xfs_mount_t *mp) _("allocation of the realtime bitmap failed, error = %d\n"), error); } - IRELE(ip); + libxfs_irele(ip); } static int @@ -678,7 +678,7 @@ _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime bitmap inode % error = -libxfs_trans_commit(tp); if (error) do_error(_("%s: commit failed, error %d\n"), __func__, error); - IRELE(ip); + libxfs_irele(ip); return(0); } @@ -733,7 +733,7 @@ fill_rsumino(xfs_mount_t *mp) do_warn( _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime summary inode %" PRIu64 "\n"), bno, map.br_startblock, mp->m_sb.sb_rsumino); - IRELE(ip); + libxfs_irele(ip); return(1); } @@ -748,7 +748,7 @@ _("can't access block %" PRIu64 " (fsbno %" PRIu64 ") of realtime summary inode error = -libxfs_trans_commit(tp); if (error) do_error(_("%s: commit failed, error %d\n"), __func__, error); - IRELE(ip); + libxfs_irele(ip); return(0); } @@ -852,7 +852,7 @@ mk_rsumino(xfs_mount_t *mp) _("allocation of the realtime summary ino failed, error = %d\n"), error); } - IRELE(ip); + libxfs_irele(ip); } /* @@ -920,7 +920,7 @@ mk_root_dir(xfs_mount_t *mp) if (error) do_error(_("%s: commit failed, error %d\n"), __func__, error); - IRELE(ip); + libxfs_irele(ip); irec = find_inode_rec(mp, XFS_INO_TO_AGNO(mp, mp->m_sb.sb_rootino), XFS_INO_TO_AGINO(mp, mp->m_sb.sb_rootino)); @@ -1054,8 +1054,8 @@ mk_orphanage(xfs_mount_t *mp) do_error(_("%s directory creation failed -- bmapf error %d\n"), ORPHANAGE, error); } - IRELE(ip); - IRELE(pip); + libxfs_irele(ip); + libxfs_irele(pip); add_inode_reached(irec,ino_offset); return(ino); @@ -1233,8 +1233,8 @@ mv_orphanage( do_error( _("orphanage name create failed (%d)\n"), err); } - IRELE(ino_p); - IRELE(orphanage_ip); + libxfs_irele(ino_p); + libxfs_irele(orphanage_ip); } static int @@ -3050,7 +3050,7 @@ process_dir_inode( _("root inode \".\" entry recreation failed (%d)\n"), error); } } - IRELE(ip); + libxfs_irele(ip); } /* diff --git a/repair/phase7.c b/repair/phase7.c index 09d11fcd..c2a60a93 100644 --- a/repair/phase7.c +++ b/repair/phase7.c @@ -77,7 +77,7 @@ update_inode_nlinks( ASSERT(error == 0); } - IRELE(ip); + libxfs_irele(ip); } /*