From patchwork Wed Mar 20 20:04:44 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: 10862557 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 A610F17E0 for ; Wed, 20 Mar 2019 20:04:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8741929A70 for ; Wed, 20 Mar 2019 20:04:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A76A29C48; Wed, 20 Mar 2019 20:04:48 +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 207B329A70 for ; Wed, 20 Mar 2019 20:04:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726366AbfCTUEr (ORCPT ); Wed, 20 Mar 2019 16:04:47 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:57114 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726023AbfCTUEr (ORCPT ); Wed, 20 Mar 2019 16:04:47 -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 x2KK4KER177284; Wed, 20 Mar 2019 20:04:45 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=y1Y1oH6YDRc+Ry2r7po0+IhJlFi4ns2v1f3KgUVfZ8g=; b=MkQokyj8pCFNVEAZ65jIpoS6eRC4lG3scSh2lVaKpQMfHGPLhrSvzBAMHRLAko4xqxTk 1diFTposgTsr4vZ1BUU8azzfdEIyKnkscbU4oMiJkQ6YsfaKRjsbPpad5H47u7AZzwws c+2j8vrTD0DHHossRsEIXlu94TPJ0AD7LYcf3wMfDJdSUCVPB3kFYF5QLWgyqHnUkY24 jaamzzFTEY2tEHgkDMDZLS1C0FQeKzdcBB4DYOw8KlWEYRe0NwAY43oE2M3X3Qm8Yn/E 3WSQAXxMoYiCxseJqyGNqFTH0soMx3khUSKJdlM9u5zB8W9JtSRPLD2KIwzjhoA8cHvf gw== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2r8pnew7g9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 20:04:44 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x2KK4hGB029001 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Mar 2019 20:04:44 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x2KK4hFw009029; Wed, 20 Mar 2019 20:04:43 GMT Received: from localhost (/10.159.247.212) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 20 Mar 2019 13:04:43 -0700 Date: Wed, 20 Mar 2019 13:04:44 -0700 From: "Darrick J. Wong" To: sandeen@sandeen.net Cc: linux-xfs@vger.kernel.org Subject: [PATCH 46/36] xfs_scrub: remove pointless xfs_verify_error_info struct Message-ID: <20190320200444.GJ1183@magnolia> References: <155259742281.31886.17157720770696604377.stgit@magnolia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <155259742281.31886.17157720770696604377.stgit@magnolia> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9201 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-1903200145 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 --- scrub/phase6.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/scrub/phase6.c b/scrub/phase6.c index 2b4f6ff1..f173f248 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 *vei = arg; struct bitmap *bmp; /* Only report errors for real extents. */ @@ -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(ve.d_bad) || !bitmap_empty(ve.r_bad)) - moveon = xfs_report_verify_errors(ctx, ve.d_bad, ve.r_bad); + moveon = xfs_report_verify_errors(ctx, &ve); bitmap_free(&ve.r_bad); bitmap_free(&ve.d_bad);