From patchwork Mon Apr 22 15:45:21 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: 10911223 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 2D7EB14DB for ; Mon, 22 Apr 2019 15:47:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E439286F2 for ; Mon, 22 Apr 2019 15:47:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12D2F286FF; Mon, 22 Apr 2019 15:47:25 +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 AAC61286F2 for ; Mon, 22 Apr 2019 15:47:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727457AbfDVPrY (ORCPT ); Mon, 22 Apr 2019 11:47:24 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:46280 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726132AbfDVPrY (ORCPT ); Mon, 22 Apr 2019 11:47:24 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3MFi1M7042620; Mon, 22 Apr 2019 15:47:22 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=pI8hZMlzqExEv543kg4NcQw9otKgQfdeQxndV21rSxo=; b=km+js8k1k0BxfuKEp5setH65JzIvDXb4adQu26Uf5GAPMh3gyPXwIgtSHfd+fd6DVcGy X5/LqN1jpAqm+GSVoxbNk12QWZtwU5NnOFQaQsc5ZLa4LjBcKzZxKFCBWdZSaokh8YFX /weMPvYPxv2E30JglZ6C2+UT45vz2l6kESNiorp2F2arWpdOTvXLpAgDb+4KsUd5FYeF /zFc3Ijc6df1v12HbfjLB7lY/XSPuaOvUhBMaZtAY0JKPA3LAQaa8TyAFEniCpWc498g HfXQc6nC5myseF7MX45l6QdLfU/3xtxkvw2f7OWS5xZWP+nkAWYuomj4KYtDMzxRji4E eA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2rytusq0m5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Apr 2019 15:47:21 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3MFiWKB186084; Mon, 22 Apr 2019 15:45:21 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 2s0f0v0kn0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 22 Apr 2019 15:45:21 +0000 Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x3MFjKgZ025783; Mon, 22 Apr 2019 15:45:20 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 22 Apr 2019 08:45:20 -0700 Subject: [PATCH 05/10] libxfs: drop the ifork_ops parameter from _inode_verify_forks From: "Darrick J. Wong" To: sandeen@sandeen.net, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Mon, 22 Apr 2019 08:45:21 -0700 Message-ID: <155594792189.115924.17675145707430115266.stgit@magnolia> In-Reply-To: <155594788997.115924.16224143537288136652.stgit@magnolia> References: <155594788997.115924.16224143537288136652.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9235 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 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-1810050000 definitions=main-1904220118 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9235 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-1904220119 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 Now that the inode remembers its own ifork_ops, we can drop the second parameter from libxfs_inode_verify_forks. Signed-off-by: Darrick J. Wong Reviewed-by: Bill O'Donnell Reviewed-by: Eric Sandeen --- include/xfs_inode.h | 3 +-- libxfs/rdwr.c | 11 +++++------ libxfs/util.c | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/xfs_inode.h b/include/xfs_inode.h index e1e8b430..52d79f3c 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -151,8 +151,7 @@ extern void libxfs_trans_ichgtime(struct xfs_trans *, extern int libxfs_iflush_int (struct xfs_inode *, struct xfs_buf *); /* Inode Cache Interfaces */ -extern bool libxfs_inode_verify_forks(struct xfs_inode *ip, - struct xfs_ifork_ops *); +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 *); diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index 69d5abb2..bc2ed38c 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -1338,16 +1338,15 @@ extern kmem_zone_t *xfs_ili_zone; */ bool libxfs_inode_verify_forks( - struct xfs_inode *ip, - struct xfs_ifork_ops *ops) + struct xfs_inode *ip) { struct xfs_ifork *ifp; xfs_failaddr_t fa; - if (!ops) + if (!ip->i_fork_ops) return true; - fa = xfs_ifork_verify_data(ip, ops); + fa = xfs_ifork_verify_data(ip, ip->i_fork_ops); if (fa) { ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); xfs_inode_verifier_error(ip, -EFSCORRUPTED, "data fork", @@ -1355,7 +1354,7 @@ libxfs_inode_verify_forks( return false; } - fa = xfs_ifork_verify_attr(ip, ops); + fa = xfs_ifork_verify_attr(ip, ip->i_fork_ops); if (fa) { ifp = XFS_IFORK_PTR(ip, XFS_ATTR_FORK); xfs_inode_verifier_error(ip, -EFSCORRUPTED, "attr fork", @@ -1392,7 +1391,7 @@ libxfs_iget( } ip->i_fork_ops = ifork_ops; - if (!libxfs_inode_verify_forks(ip, ifork_ops)) { + if (!libxfs_inode_verify_forks(ip)) { libxfs_irele(ip); return -EFSCORRUPTED; } diff --git a/libxfs/util.c b/libxfs/util.c index 2e3b9d51..ea75fa20 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -422,7 +422,7 @@ libxfs_iflush_int(xfs_inode_t *ip, xfs_buf_t *bp) VFS_I(ip)->i_version++; /* Check the inline fork data before we write out. */ - if (!libxfs_inode_verify_forks(ip, ip->i_fork_ops)) + if (!libxfs_inode_verify_forks(ip)) return -EFSCORRUPTED; /*