From patchwork Thu Apr 4 17:10:56 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: 10885993 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 6655A17E0 for ; Thu, 4 Apr 2019 17:11:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D2AA1FF14 for ; Thu, 4 Apr 2019 17:11:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41AE828A21; Thu, 4 Apr 2019 17:11:04 +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 D85A41FF14 for ; Thu, 4 Apr 2019 17:11:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729629AbfDDRLD (ORCPT ); Thu, 4 Apr 2019 13:11:03 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:33530 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727152AbfDDRLC (ORCPT ); Thu, 4 Apr 2019 13:11:02 -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 x34H8d9E142771; Thu, 4 Apr 2019 17:11:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=jaWpwqmTgjZ06xWs3EIymTbeg44omlyzfn1iHNrke0A=; b=RcRpNgJ7J8thCi7u5FajmKtZn7ayepkUwCz/RGreTWlHDyA0orw8H6DV+P9WI5ZB51Be w4Xjd8nnLi33usAWObiKRluclpldVXbSdxu8lonqhJ4N0t1F3Vpyar8h1qreH0Dy9ad5 Juluqw/24d4Nm4hatMNNtKX/aJ9+iZr0YN1gUfdYqOQWeESH8IdFwYsmGawWLcS6O5c/ 0bemnsaaSChJpSOh6gQCy5Fe3x+CBQaJV5JQ3BNdCjYmJkMv9GWpCUp2DjVQ+9L8hxNY 7H40NwWGs49rNHQed0NB/DUNjRI5DD2Fhfoclz+lGAsQZkbT6sxzYrYGsUUuLuNimtN4 vQ== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2rhyvtghtc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Apr 2019 17:10:59 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x34HAGfG087713; Thu, 4 Apr 2019 17:10:59 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 2rm8f5t3u4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 04 Apr 2019 17:10:59 +0000 Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x34HAwaY010715; Thu, 4 Apr 2019 17:10:58 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 04 Apr 2019 10:10:58 -0700 Date: Thu, 4 Apr 2019 10:10:56 -0700 From: "Darrick J. Wong" To: sandeen@sandeen.net Cc: linux-xfs@vger.kernel.org Subject: [PATCH v2 46/36] xfs_scrub: remove pointless xfs_verify_error_info struct Message-ID: <20190404171056.GR5147@magnolia> References: <155259742281.31886.17157720770696604377.stgit@magnolia> <20190320200444.GJ1183@magnolia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190320200444.GJ1183@magnolia> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9217 signatures=668685 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-1810050000 definitions=main-1904040110 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9217 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=3 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-1904040110 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 The xfs_verify_error_info structure is a strict subset of media_verify_info so just pass that around. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen --- scrub/phase6.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/scrub/phase6.c b/scrub/phase6.c index 91e4443e..e819e085 100644 --- a/scrub/phase6.c +++ b/scrub/phase6.c @@ -111,11 +111,6 @@ xfs_decode_special_owner( /* Routines to translate bad physical extents into file paths and offsets. */ -struct xfs_verify_error_info { - struct bitmap *d_bad; /* bytes */ - struct bitmap *r_bad; /* bytes */ -}; - /* Report if this extent overlaps a bad region. */ static bool xfs_report_verify_inode_bmap( @@ -127,7 +122,7 @@ xfs_report_verify_inode_bmap( struct xfs_bmap *bmap, void *arg) { - struct xfs_verify_error_info *vei = arg; + struct media_verify_state *vs = arg; struct bitmap *bmp; /* Only report errors for real extents. */ @@ -135,9 +130,9 @@ xfs_report_verify_inode_bmap( return true; if (fsx->fsx_xflags & FS_XFLAG_REALTIME) - bmp = vei->r_bad; + bmp = vs->r_bad; else - bmp = vei->d_bad; + bmp = vs->d_bad; if (!bitmap_test(bmp, bmap->bm_physical, bmap->bm_length)) return true; @@ -277,23 +272,18 @@ xfs_report_verify_dirent( static bool xfs_report_verify_errors( struct scrub_ctx *ctx, - struct bitmap *d_bad, - struct bitmap *r_bad) + struct media_verify_state *ve) { - struct xfs_verify_error_info vei; bool moveon; - vei.d_bad = d_bad; - vei.r_bad = r_bad; - /* Scan the directory tree to get file paths. */ moveon = scan_fs_tree(ctx, xfs_report_verify_dir, - xfs_report_verify_dirent, &vei); + xfs_report_verify_dirent, ve); if (!moveon) return false; /* Scan for unlinked files. */ - return xfs_scan_all_inodes(ctx, xfs_report_verify_inode, &vei); + return xfs_scan_all_inodes(ctx, xfs_report_verify_inode, ve); } /* Report an IO error resulting from read-verify based off getfsmap. */ @@ -518,7 +508,7 @@ _("Could not create data device media verifier.")); /* Scan the whole dir tree to see what matches the bad extents. */ if (!bitmap_empty(vs.d_bad) || !bitmap_empty(vs.r_bad)) - moveon = xfs_report_verify_errors(ctx, vs.d_bad, vs.r_bad); + moveon = xfs_report_verify_errors(ctx, &vs); bitmap_free(&vs.r_bad); bitmap_free(&vs.d_bad);