From patchwork Thu Mar 14 21:07:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10853657 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 EA54F17E6 for ; Thu, 14 Mar 2019 21:07:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D07C129DEC for ; Thu, 14 Mar 2019 21:07:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4A7D29E96; Thu, 14 Mar 2019 21:07:40 +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 2EF2C29DEC for ; Thu, 14 Mar 2019 21:07:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727894AbfCNVHj (ORCPT ); Thu, 14 Mar 2019 17:07:39 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:53848 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727366AbfCNVHj (ORCPT ); Thu, 14 Mar 2019 17:07:39 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2EKwsNC132890; Thu, 14 Mar 2019 21:07:37 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=iF73ka7hLYvkMICkEGwAtdCd7wEAsrfcPPBTKKgePjg=; b=086Df8C1YAKx3P7CUReTvAwpN3dLRat24aBoCo/KuFT9xvKNCPVSBj2p01JQjCJ071m3 PSYHNZ6OHtM0/6iuB/5ZIIzHmy7yQKv/ShERPWelMVvpyRaAuRp11KHNztZYqOWU18io 4JJyLfd1y4q8erYeGhhAQOGF7jRynauZGhH7QtTy7bI2H4JK4fXRgCcWm/JnpkCBAary O6TGlBTugZIY2XoWwQRtLLmPfVivDd1/7AfpDqQv1p7F8M2dW8HaK9kDQZi9et/WnWOL cP9GgPHBPe1WIHQM/LabL4xDIi9ExU410fTa/AL34qjG0Re9Dq0x+VK0MTxd0JCGJDMs 7A== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2r430f3y09-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Mar 2019 21:07:36 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x2EL7a7h025389 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Mar 2019 21:07:36 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x2EL7ZV9004286; Thu, 14 Mar 2019 21:07:35 GMT Received: from localhost (/10.145.178.102) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 14 Mar 2019 21:07:35 +0000 Subject: [PATCH 36/36] libxfs: remove libxfs_trans_iget From: "Darrick J. Wong" To: sandeen@sandeen.net, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Thu, 14 Mar 2019 14:07:33 -0700 Message-ID: <155259765381.31886.8973943242633989393.stgit@magnolia> In-Reply-To: <155259742281.31886.17157720770696604377.stgit@magnolia> References: <155259742281.31886.17157720770696604377.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9195 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903140143 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 libxfs_trans_iget no longer has a counterpart in the kernel. Remove it and make the xfs_iget/xfs_trans_ijoin usage consistent throughout xfsprogs. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen --- include/xfs_trans.h | 2 -- libxfs/libxfs_api_defs.h | 1 - libxfs/trans.c | 35 ----------------------------------- libxfs/util.c | 4 +++- repair/phase6.c | 21 +++++++++++++++------ repair/phase7.c | 4 ++-- 6 files changed, 20 insertions(+), 47 deletions(-) diff --git a/include/xfs_trans.h b/include/xfs_trans.h index 9e44d18e..e6bb74c4 100644 --- a/include/xfs_trans.h +++ b/include/xfs_trans.h @@ -98,8 +98,6 @@ void xfs_defer_cancel(struct xfs_trans *); struct xfs_buf *libxfs_trans_getsb(struct xfs_trans *, struct xfs_mount *, int); -int libxfs_trans_iget(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, - uint, uint, struct xfs_inode **); void libxfs_trans_ijoin(struct xfs_trans *, struct xfs_inode *, uint); void libxfs_trans_ijoin_ref(struct xfs_trans *, struct xfs_inode *, int); void libxfs_trans_log_inode (struct xfs_trans *, struct xfs_inode *, diff --git a/libxfs/libxfs_api_defs.h b/libxfs/libxfs_api_defs.h index e10d78cd..bb0f07bd 100644 --- a/libxfs/libxfs_api_defs.h +++ b/libxfs/libxfs_api_defs.h @@ -31,7 +31,6 @@ #define xfs_trans_del_item libxfs_trans_del_item #define xfs_trans_get_buf libxfs_trans_get_buf #define xfs_trans_getsb libxfs_trans_getsb -#define xfs_trans_iget libxfs_trans_iget #define xfs_trans_ichgtime libxfs_trans_ichgtime #define xfs_trans_ijoin libxfs_trans_ijoin #define xfs_trans_init libxfs_trans_init diff --git a/libxfs/trans.c b/libxfs/trans.c index ce199654..d6785e20 100644 --- a/libxfs/trans.c +++ b/libxfs/trans.c @@ -336,41 +336,6 @@ libxfs_trans_cancel( return; } -int -libxfs_trans_iget( - xfs_mount_t *mp, - xfs_trans_t *tp, - xfs_ino_t ino, - uint flags, - uint lock_flags, - xfs_inode_t **ipp) -{ - int error; - xfs_inode_t *ip; - xfs_inode_log_item_t *iip; - - if (tp == NULL) - return libxfs_iget(mp, tp, ino, lock_flags, ipp, - &xfs_default_ifork_ops); - - error = libxfs_iget(mp, tp, ino, lock_flags, &ip, - &xfs_default_ifork_ops); - if (error) - return error; - ASSERT(ip != NULL); - - if (ip->i_itemp == NULL) - xfs_inode_item_init(ip, mp); - iip = ip->i_itemp; - xfs_trans_add_item(tp, (xfs_log_item_t *)(iip)); - - /* initialize i_transp so we can find it incore */ - ip->i_transp = tp; - - *ipp = ip; - return 0; -} - void libxfs_trans_ijoin( xfs_trans_t *tp, diff --git a/libxfs/util.c b/libxfs/util.c index 0799f965..2e3b9d51 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -262,7 +262,8 @@ libxfs_ialloc( } ASSERT(*ialloc_context == NULL); - error = xfs_trans_iget(tp->t_mountp, tp, ino, 0, 0, &ip); + error = libxfs_iget(tp->t_mountp, tp, ino, 0, &ip, + &xfs_default_ifork_ops); if (error != 0) return error; ASSERT(ip != NULL); @@ -376,6 +377,7 @@ libxfs_ialloc( /* * Log the new values stuffed into the inode. */ + xfs_trans_ijoin(tp, ip, 0); xfs_trans_log_inode(tp, ip, flags); *ipp = ip; return 0; diff --git a/repair/phase6.c b/repair/phase6.c index 194cfdbf..28e633de 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -535,7 +535,8 @@ mk_rbmino(xfs_mount_t *mp) if (i) res_failed(i); - error = -libxfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, 0, &ip); + error = -libxfs_iget(mp, tp, mp->m_sb.sb_rbmino, 0, &ip, + &xfs_default_ifork_ops); if (error) { do_error( _("couldn't iget realtime bitmap inode -- error - %d\n"), @@ -572,6 +573,7 @@ mk_rbmino(xfs_mount_t *mp) /* * commit changes */ + libxfs_trans_ijoin(tp, ip, 0); libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); error = -libxfs_trans_commit(tp); if (error) @@ -634,7 +636,8 @@ fill_rbmino(xfs_mount_t *mp) if (error) res_failed(error); - error = -libxfs_trans_iget(mp, tp, mp->m_sb.sb_rbmino, 0, 0, &ip); + error = -libxfs_iget(mp, tp, mp->m_sb.sb_rbmino, 0, &ip, + &xfs_default_ifork_ops); if (error) { do_error( _("couldn't iget realtime bitmap inode -- error - %d\n"), @@ -645,6 +648,7 @@ fill_rbmino(xfs_mount_t *mp) /* * fill the file one block at a time */ + libxfs_trans_ijoin(tp, ip, 0); nmap = 1; error = -libxfs_bmapi_write(tp, ip, bno, 1, 0, 1, &map, &nmap); if (error || nmap != 1) { @@ -703,7 +707,8 @@ fill_rsumino(xfs_mount_t *mp) if (error) res_failed(error); - error = -libxfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 0, 0, &ip); + error = -libxfs_iget(mp, tp, mp->m_sb.sb_rsumino, 0, &ip, + &xfs_default_ifork_ops); if (error) { do_error( _("couldn't iget realtime summary inode -- error - %d\n"), @@ -714,6 +719,7 @@ fill_rsumino(xfs_mount_t *mp) /* * fill the file one block at a time */ + libxfs_trans_ijoin(tp, ip, 0); nmap = 1; error = -libxfs_bmapi_write(tp, ip, bno, 1, 0, 1, &map, &nmap); if (error || nmap != 1) { @@ -775,7 +781,8 @@ mk_rsumino(xfs_mount_t *mp) if (i) res_failed(i); - error = -libxfs_trans_iget(mp, tp, mp->m_sb.sb_rsumino, 0, 0, &ip); + error = -libxfs_iget(mp, tp, mp->m_sb.sb_rsumino, 0, &ip, + &xfs_default_ifork_ops); if (error) { do_error( _("couldn't iget realtime summary inode -- error - %d\n"), @@ -812,6 +819,7 @@ mk_rsumino(xfs_mount_t *mp) /* * commit changes */ + libxfs_trans_ijoin(tp, ip, 0); libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); error = -libxfs_trans_commit(tp); if (error) @@ -875,7 +883,8 @@ mk_root_dir(xfs_mount_t *mp) if (i) res_failed(i); - error = -libxfs_trans_iget(mp, tp, mp->m_sb.sb_rootino, 0, 0, &ip); + error = -libxfs_iget(mp, tp, mp->m_sb.sb_rootino, 0, &ip, + &xfs_default_ifork_ops); if (error) { do_error(_("could not iget root inode -- error - %d\n"), error); } @@ -900,7 +909,7 @@ mk_root_dir(xfs_mount_t *mp) times |= XFS_ICHGTIME_CREATE; } libxfs_trans_ichgtime(tp, ip, times); - + libxfs_trans_ijoin(tp, ip, 0); libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); /* diff --git a/repair/phase7.c b/repair/phase7.c index c2a60a93..c2996470 100644 --- a/repair/phase7.c +++ b/repair/phase7.c @@ -32,8 +32,7 @@ update_inode_nlinks( error = -libxfs_trans_alloc(mp, &M_RES(mp)->tr_remove, nres, 0, 0, &tp); ASSERT(error == 0); - error = -libxfs_trans_iget(mp, tp, ino, 0, 0, &ip); - + error = -libxfs_iget(mp, tp, ino, 0, &ip, &xfs_default_ifork_ops); if (error) { if (!no_modify) do_error( @@ -67,6 +66,7 @@ update_inode_nlinks( if (!dirty) { libxfs_trans_cancel(tp); } else { + libxfs_trans_ijoin(tp, ip, 0); libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); /* * no need to do a bmap finish since