linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs: change xfs_update_secondary_supers to use xfS_sb_read_secondary
@ 2018-05-15 20:47 Darrick J. Wong
  2018-05-15 20:50 ` Eric Sandeen
  2018-05-15 23:08 ` Dave Chinner
  0 siblings, 2 replies; 7+ messages in thread
From: Darrick J. Wong @ 2018-05-15 20:47 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs

From: Darrick J. Wong <darrick.wong@oracle.com>

Use the new helper to read secondary superblocks instead of opencoding
it ourselves.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_fsops.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

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",

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-05-16  1:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-15 20:47 [PATCH] xfs: change xfs_update_secondary_supers to use xfS_sb_read_secondary Darrick J. Wong
2018-05-15 20:50 ` Eric Sandeen
2018-05-15 23:08 ` Dave Chinner
2018-05-15 23:36   ` Darrick J. Wong
2018-05-16  0:23     ` Dave Chinner
2018-05-16  0:41       ` Darrick J. Wong
2018-05-16  1:04         ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).