From patchwork Tue May 15 20:47:21 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: 10401967 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7FA5D601D2 for ; Tue, 15 May 2018 20:47:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E2BF285D8 for ; Tue, 15 May 2018 20:47:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62D11285DC; Tue, 15 May 2018 20:47:43 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, 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 E48B9285D8 for ; Tue, 15 May 2018 20:47:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752236AbeEOUrm (ORCPT ); Tue, 15 May 2018 16:47:42 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:52752 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752134AbeEOUrl (ORCPT ); Tue, 15 May 2018 16:47:41 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w4FKk2nH180712; Tue, 15 May 2018 20:47:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=/L/wvO8MxWiye3k+IiN3FaScpk7QsbeDsO8fZo9/Ak0=; b=NSvX4QyvYDlY5BmE6071IOIydGoB+eJIIfdBAziDuMxzz1Z8Yj51Y8y/lVpo+g1CUfA7 O46RquR3FXeEK5kqjrDJ7uAX+IsvV8ZIO12lxA7givWiC5ym9b6/kBQ147K5nYDBcDkm hToGymjodPcnWyFG8Y+4A/l4Snz7HRPlUNu/xur58Fj1nynXJEnsp4bPDB+pnv/x+nCz /NYRnRAGIP9sDNDJq1cVtcCLSu9P3ZcwefyrsyZ5LXcodjNPKCCqx2X8uwdG/61MmJXd S2BUC5y7d436ymCWD0T8cuRUE1MJXw4D1QtcybM8v5YCGWC06uhuiY+0oICgf4AS4cvb 1Q== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2hx29w25qm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 May 2018 20:47:24 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w4FKlNbt029657 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 May 2018 20:47:23 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w4FKlMp9008495; Tue, 15 May 2018 20:47:22 GMT Received: from localhost (/67.169.218.210) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 15 May 2018 13:47:22 -0700 Date: Tue, 15 May 2018 13:47:21 -0700 From: "Darrick J. Wong" To: Eric Sandeen Cc: xfs Subject: [PATCH] xfs: change xfs_update_secondary_supers to use xfS_sb_read_secondary Message-ID: <20180515204721.GM4933@magnolia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8894 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=917 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1805150203 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 Use the new helper to read secondary superblocks instead of opencoding it ourselves. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen --- fs/xfs/xfs_fsops.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index 056a76689197..40c131ebf772 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c @@ -191,18 +191,15 @@ xfs_growfs_data_private( */ int xfs_update_secondary_supers( - xfs_mount_t *mp) + struct xfs_mount *mp) { - int error, saved_error; + struct xfs_buf *bp; xfs_agnumber_t agno; - xfs_buf_t *bp; + int error, saved_error; error = saved_error = 0; for (agno = 1; agno < mp->m_sb.sb_agcount; agno++) { - error = xfs_trans_read_buf(mp, NULL, mp->m_ddev_targp, - XFS_AGB_TO_DADDR(mp, agno, XFS_SB_BLOCK(mp)), - XFS_FSS_TO_BB(mp, 1), 0, &bp, &xfs_sb_buf_ops); /* * If we get an error reading or writing alternate superblocks, * continue. xfs_repair chooses the "best" superblock based @@ -210,6 +207,7 @@ xfs_update_secondary_supers( * superblocks un-updated than updated, and xfs_repair may * pick them over the properly-updated primary. */ + error = xfs_sb_read_secondary(mp, NULL, agno, &bp); if (error) { xfs_warn(mp, "error %d reading secondary superblock for ag %d",