Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@sandeen.net
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH v2 45/36] xfs_scrub: rename confusing structure
Date: Thu, 4 Apr 2019 10:10:23 -0700	[thread overview]
Message-ID: <20190404171023.GQ5147@magnolia> (raw)
In-Reply-To: <20190320200330.GI1183@magnolia>

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

Rename xfs_verify_extent to media_verify_state so that the name more
accurately reflects what we're storing in the structure.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 scrub/phase6.c |   70 ++++++++++++++++++++++++++++----------------------------
 1 file changed, 35 insertions(+), 35 deletions(-)

diff --git a/scrub/phase6.c b/scrub/phase6.c
index 5e2b9ee3..91e4443e 100644
--- a/scrub/phase6.c
+++ b/scrub/phase6.c
@@ -35,7 +35,7 @@
 
 /* Verify disk blocks with GETFSMAP */
 
-struct xfs_verify_extent {
+struct media_verify_state {
 	struct read_verify_pool	*rvp_data;
 	struct read_verify_pool	*rvp_log;
 	struct read_verify_pool	*rvp_realtime;
@@ -47,15 +47,15 @@ struct xfs_verify_extent {
 static struct read_verify_pool *
 xfs_dev_to_pool(
 	struct scrub_ctx		*ctx,
-	struct xfs_verify_extent	*ve,
+	struct media_verify_state	*vs,
 	dev_t				dev)
 {
 	if (dev == ctx->fsinfo.fs_datadev)
-		return ve->rvp_data;
+		return vs->rvp_data;
 	else if (dev == ctx->fsinfo.fs_logdev)
-		return ve->rvp_log;
+		return vs->rvp_log;
 	else if (dev == ctx->fsinfo.fs_rtdev)
-		return ve->rvp_realtime;
+		return vs->rvp_realtime;
 	abort();
 }
 
@@ -348,7 +348,7 @@ xfs_check_rmap_ioerr(
 {
 	struct fsmap			keys[2];
 	char				descr[DESCR_BUFSZ];
-	struct xfs_verify_extent	*ve = arg;
+	struct media_verify_state	*vs = arg;
 	struct bitmap			*tree;
 	dev_t				dev;
 	bool				moveon;
@@ -360,9 +360,9 @@ xfs_check_rmap_ioerr(
 	 * later rescanning.
 	 */
 	if (dev == ctx->fsinfo.fs_datadev)
-		tree = ve->d_bad;
+		tree = vs->d_bad;
 	else if (dev == ctx->fsinfo.fs_rtdev)
-		tree = ve->r_bad;
+		tree = vs->r_bad;
 	else
 		tree = NULL;
 	if (tree) {
@@ -395,10 +395,10 @@ xfs_check_rmap(
 	struct fsmap			*map,
 	void				*arg)
 {
-	struct xfs_verify_extent	*ve = arg;
+	struct media_verify_state	*vs = arg;
 	struct read_verify_pool		*rvp;
 
-	rvp = xfs_dev_to_pool(ctx, ve, map->fmr_device);
+	rvp = xfs_dev_to_pool(ctx, vs, map->fmr_device);
 
 	dbg_printf("rmap dev %d:%d phys %"PRIu64" owner %"PRId64
 			" offset %"PRIu64" len %"PRIu64" flags 0x%x\n",
@@ -425,7 +425,7 @@ xfs_check_rmap(
 	/* XXX: Filter out directory data blocks. */
 
 	/* Schedule the read verify command for (eventual) running. */
-	read_verify_schedule_io(rvp, map->fmr_physical, map->fmr_length, ve);
+	read_verify_schedule_io(rvp, map->fmr_physical, map->fmr_length, vs);
 
 out:
 	/* Is this the last extent?  Fire off the read. */
@@ -463,35 +463,35 @@ bool
 xfs_scan_blocks(
 	struct scrub_ctx		*ctx)
 {
-	struct xfs_verify_extent	ve = { NULL };
+	struct media_verify_state	vs = { NULL };
 	bool				moveon;
 
-	moveon = bitmap_init(&ve.d_bad);
+	moveon = bitmap_init(&vs.d_bad);
 	if (!moveon) {
 		str_errno(ctx, ctx->mntpoint);
 		goto out;
 	}
 
-	moveon = bitmap_init(&ve.r_bad);
+	moveon = bitmap_init(&vs.r_bad);
 	if (!moveon) {
 		str_errno(ctx, ctx->mntpoint);
 		goto out_dbad;
 	}
 
-	ve.rvp_data = read_verify_pool_init(ctx, ctx->datadev,
+	vs.rvp_data = read_verify_pool_init(ctx, ctx->datadev,
 			ctx->geo.blocksize, xfs_check_rmap_ioerr,
 			scrub_nproc(ctx));
-	if (!ve.rvp_data) {
+	if (!vs.rvp_data) {
 		moveon = false;
 		str_info(ctx, ctx->mntpoint,
 _("Could not create data device media verifier."));
 		goto out_rbad;
 	}
 	if (ctx->logdev) {
-		ve.rvp_log = read_verify_pool_init(ctx, ctx->logdev,
+		vs.rvp_log = read_verify_pool_init(ctx, ctx->logdev,
 				ctx->geo.blocksize, xfs_check_rmap_ioerr,
 				scrub_nproc(ctx));
-		if (!ve.rvp_log) {
+		if (!vs.rvp_log) {
 			moveon = false;
 			str_info(ctx, ctx->mntpoint,
 	_("Could not create log device media verifier."));
@@ -499,43 +499,43 @@ _("Could not create data device media verifier."));
 		}
 	}
 	if (ctx->rtdev) {
-		ve.rvp_realtime = read_verify_pool_init(ctx, ctx->rtdev,
+		vs.rvp_realtime = read_verify_pool_init(ctx, ctx->rtdev,
 				ctx->geo.blocksize, xfs_check_rmap_ioerr,
 				scrub_nproc(ctx));
-		if (!ve.rvp_realtime) {
+		if (!vs.rvp_realtime) {
 			moveon = false;
 			str_info(ctx, ctx->mntpoint,
 	_("Could not create realtime device media verifier."));
 			goto out_logpool;
 		}
 	}
-	moveon = xfs_scan_all_spacemaps(ctx, xfs_check_rmap, &ve);
+	moveon = xfs_scan_all_spacemaps(ctx, xfs_check_rmap, &vs);
 	if (!moveon)
 		goto out_rtpool;
-	ctx->bytes_checked += clean_pool(ve.rvp_data);
-	ctx->bytes_checked += clean_pool(ve.rvp_log);
-	ctx->bytes_checked += clean_pool(ve.rvp_realtime);
+	ctx->bytes_checked += clean_pool(vs.rvp_data);
+	ctx->bytes_checked += clean_pool(vs.rvp_log);
+	ctx->bytes_checked += clean_pool(vs.rvp_realtime);
 
 	/* 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);
+	if (!bitmap_empty(vs.d_bad) || !bitmap_empty(vs.r_bad))
+		moveon = xfs_report_verify_errors(ctx, vs.d_bad, vs.r_bad);
 
-	bitmap_free(&ve.r_bad);
-	bitmap_free(&ve.d_bad);
+	bitmap_free(&vs.r_bad);
+	bitmap_free(&vs.d_bad);
 	return moveon;
 
 out_rtpool:
-	if (ve.rvp_realtime)
-		read_verify_pool_destroy(ve.rvp_realtime);
+	if (vs.rvp_realtime)
+		read_verify_pool_destroy(vs.rvp_realtime);
 out_logpool:
-	if (ve.rvp_log)
-		read_verify_pool_destroy(ve.rvp_log);
+	if (vs.rvp_log)
+		read_verify_pool_destroy(vs.rvp_log);
 out_datapool:
-	read_verify_pool_destroy(ve.rvp_data);
+	read_verify_pool_destroy(vs.rvp_data);
 out_rbad:
-	bitmap_free(&ve.r_bad);
+	bitmap_free(&vs.r_bad);
 out_dbad:
-	bitmap_free(&ve.d_bad);
+	bitmap_free(&vs.d_bad);
 out:
 	return moveon;
 }

  parent reply	other threads:[~2019-04-04 17:10 UTC|newest]

Thread overview: 135+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 21:03 [PATCH v2 00/36] xfsprogs-5.0: fix various problems Darrick J. Wong
2019-03-14 21:03 ` [PATCH 01/36] libxfs: fix repair deadlock due to failed inode flushes Darrick J. Wong
2019-03-15 22:01   ` Allison Henderson
2019-03-14 21:03 ` [PATCH 02/36] configure: use sys/xattr.h for fsetxattr detection Darrick J. Wong
2019-03-15 22:01   ` Allison Henderson
2019-03-14 21:04 ` [PATCH 03/36] configure.ac: fix alignment of features Darrick J. Wong
2019-03-14 23:46   ` Eric Sandeen
2019-03-15 22:02   ` Allison Henderson
2019-03-14 21:04 ` [PATCH 04/36] debian: drop dangling libhandle.a symlinks in xfslibs-dev Darrick J. Wong
2019-03-15  0:14   ` Nathan Scott
2019-03-15 22:02   ` Allison Henderson
2019-03-14 21:04 ` [PATCH 05/36] debian: don't bypass top level Makefile when building subdirs Darrick J. Wong
2019-03-15  0:16   ` Nathan Scott
2019-03-15 22:02   ` Allison Henderson
2019-03-14 21:04 ` [PATCH 06/36] debian: enable parallel make Darrick J. Wong
2019-03-15  0:18   ` Nathan Scott
2019-03-15  1:01     ` Darrick J. Wong
2019-03-15  5:30       ` Darrick J. Wong
2019-03-14 21:04 ` [PATCH 07/36] xfs_io: actually check copy file range helper return values Darrick J. Wong
2019-03-15  2:12   ` Eric Sandeen
2019-03-15  2:56     ` Darrick J. Wong
2019-03-15 16:51       ` Eric Sandeen
2019-03-17 22:45         ` Dave Chinner
2019-03-14 21:04 ` [PATCH 08/36] xfs_io: statx -r should print attributes_mask Darrick J. Wong
2019-04-03 16:31   ` Eric Sandeen
2019-03-14 21:04 ` [PATCH 09/36] xfs_io: don't walk off the end of argv in fzero_f Darrick J. Wong
2019-03-15  0:25   ` [PATCH 09.5/36] xfs_io: document fzero_f -k option in manpage Eric Sandeen
2019-03-15  0:31     ` Darrick J. Wong
2019-03-15  3:06   ` [PATCH 09/36] xfs_io: don't walk off the end of argv in fzero_f Eric Sandeen
2019-03-14 21:04 ` [PATCH 10/36] xfs_scrub_all: walk the lsblk device/fs hierarchy correctly Darrick J. Wong
2019-03-15  2:46   ` Eric Sandeen
2019-03-15  2:55     ` Darrick J. Wong
2019-03-14 21:04 ` [PATCH 11/36] xfs_scrub_all.timer: activate after most of the system is up Darrick J. Wong
2019-03-15  2:56   ` Eric Sandeen
2019-03-15  2:59     ` Darrick J. Wong
2019-03-15  3:02   ` Eric Sandeen
2019-03-14 21:05 ` [PATCH 12/36] xfs_scrub: rename the global nr_threads Darrick J. Wong
2019-03-15  3:09   ` Eric Sandeen
2019-03-14 21:05 ` [PATCH 13/36] xfs_scrub: use datadev parallelization estimates for thread count Darrick J. Wong
2019-03-15 17:36   ` Eric Sandeen
2019-03-15 17:41     ` Darrick J. Wong
2019-03-14 21:05 ` [PATCH 14/36] xfs_scrub: don't expose internal pool state Darrick J. Wong
2019-03-15 17:49   ` Eric Sandeen
2019-03-14 21:05 ` [PATCH 15/36] xfs_scrub: one read/verify pool per disk Darrick J. Wong
2019-03-20 20:03   ` Eric Sandeen
2019-03-20 20:06   ` [PATCH v2 " Darrick J. Wong
2019-03-28 22:57     ` Eric Sandeen
2019-03-14 21:05 ` [PATCH 16/36] xfs_scrub: don't close mnt_fd when mnt_fd open fails Darrick J. Wong
2019-03-20 20:06   ` Eric Sandeen
2019-03-14 21:05 ` [PATCH 17/36] xfs_scrub: check label for misleading characters Darrick J. Wong
2019-03-20 20:09   ` Eric Sandeen
2019-03-20 20:13     ` Darrick J. Wong
2019-03-28 23:00   ` Eric Sandeen
2019-03-14 21:05 ` [PATCH 18/36] scrub: fix Makefile targets which depend on builddefs Darrick J. Wong
2019-03-20 20:23   ` Eric Sandeen
2019-03-21 20:39     ` Darrick J. Wong
2019-03-14 21:05 ` [PATCH 19/36] mkfs: validate extent size hint parameters Darrick J. Wong
2019-03-26 16:59   ` Eric Sandeen
2019-03-26 17:56     ` Darrick J. Wong
2019-04-12 19:31   ` [PATCH v2 " Darrick J. Wong
2019-03-14 21:05 ` [PATCH 20/36] xfs_db: fix finobt record decoding when sparse inodes enabled Darrick J. Wong
2019-03-26 17:05   ` Eric Sandeen
2019-03-26 17:08     ` Darrick J. Wong
2019-03-14 21:05 ` [PATCH 21/36] xfs_db: use TYP_FINOBT for finobt metadump Darrick J. Wong
2019-03-26 17:11   ` Eric Sandeen
2019-03-14 21:06 ` [PATCH 22/36] xfs_info: use findmnt to handle mounted block devices Darrick J. Wong
2019-03-26 17:28   ` Eric Sandeen
2019-04-18 19:12     ` Darrick J. Wong
2019-03-14 21:06 ` [PATCH 23/36] xfs_repair: reinitialize the root directory nlink correctly Darrick J. Wong
2019-04-09 20:44   ` Eric Sandeen
2019-03-14 21:06 ` [PATCH 24/36] xfs_repair: bump the irec on-disk nlink when adding lost+found Darrick J. Wong
2019-04-09 20:46   ` Eric Sandeen
2019-03-14 21:06 ` [PATCH 25/36] xfs_repair: fix uninitialized variable warnings Darrick J. Wong
2019-03-26 19:56   ` Eric Sandeen
2019-03-26 21:21     ` Darrick J. Wong
2019-04-09 20:40   ` Eric Sandeen
2019-03-14 21:06 ` [PATCH 26/36] xfs_repair: refactor buffer ops assignments during phase 5 Darrick J. Wong
2019-04-09 21:11   ` Eric Sandeen
2019-04-10 15:25   ` [PATCH v2 " Darrick J. Wong
2019-04-12 20:29     ` Eric Sandeen
2019-03-14 21:06 ` [PATCH 27/36] xfs_repair: pass ops through during scan Darrick J. Wong
2019-04-12 20:30   ` Eric Sandeen
2019-03-14 21:06 ` [PATCH 28/36] libfrog: hoist bitmap out of scrub Darrick J. Wong
2019-04-03 18:33   ` Eric Sandeen
2019-03-14 21:06 ` [PATCH 29/36] xfs_repair: correctly account for free space btree shrinks when fixing freelist Darrick J. Wong
2019-03-14 21:06 ` [PATCH 30/36] libxfs: retain ifork_ops when flushing inode Darrick J. Wong
2019-04-05 18:17   ` Eric Sandeen
2019-04-05 18:19     ` Eric Sandeen
2019-04-05 20:06       ` Darrick J. Wong
2019-03-14 21:07 ` [PATCH 31/36] libxfs: refactor the open-coded libxfs_trans_bjoin calls Darrick J. Wong
2019-04-05 18:39   ` Eric Sandeen
2019-03-14 21:07 ` [PATCH 32/36] libxfs: refactor buffer item release code Darrick J. Wong
2019-03-14 21:07 ` [PATCH 33/36] libxfs: don't touch buffer log item pointer when flushing inode log item Darrick J. Wong
2019-03-14 21:07 ` [PATCH 34/36] libxfs: fix buffer log item lifetime weirdness Darrick J. Wong
2019-03-14 21:07 ` [PATCH 35/36] libxfs: shorten inode item lifetime Darrick J. Wong
2019-03-14 21:07 ` [PATCH 36/36] libxfs: remove libxfs_trans_iget Darrick J. Wong
2019-04-05 19:28   ` Eric Sandeen
2019-03-20 19:34 ` [PATCH 37/36] xfs_scrub: include unicrash.h in unicrash.c Darrick J. Wong
2019-04-04 21:07   ` Eric Sandeen
2019-03-20 19:34 ` [PATCH 38/36] xfs_io: don't read garbage stack contents if INUMBERS goes nuts Darrick J. Wong
2019-04-04 21:12   ` Eric Sandeen
2019-04-04 21:39     ` Darrick J. Wong
2019-03-20 19:35 ` [PATCH 39/36] misc: fix strncpy length complaints Darrick J. Wong
2019-04-04 21:30   ` Eric Sandeen
2019-04-18 18:51     ` Darrick J. Wong
2019-03-20 19:36 ` [PATCH 40/36] xfs_io: fix label parsing and validation Darrick J. Wong
2019-04-04 21:51   ` Eric Sandeen
2019-03-20 19:36 ` [PATCH 41/36] xfs_repair: better cli option parameter checking Darrick J. Wong
2019-04-04 22:08   ` Eric Sandeen
2019-03-20 19:36 ` [PATCH 42/36] xfs_db: refactor metadump handling of multi-fsb objects Darrick J. Wong
2019-04-04 22:17   ` Eric Sandeen
2019-03-20 19:37 ` [PATCH 43/36] xfs_db: refactor multi-fsb object detection decision making Darrick J. Wong
2019-04-04 23:49   ` Eric Sandeen
2019-04-05  0:01     ` Darrick J. Wong
2019-04-05  0:09   ` [PATCH v2 " Darrick J. Wong
2019-04-05 20:31     ` Eric Sandeen
2019-03-20 19:37 ` [PATCH 44/36] xfs_db: metadump should handle symlinks properly Darrick J. Wong
2019-04-05 14:18   ` Eric Sandeen
2019-04-05 14:44     ` Darrick J. Wong
2019-03-20 20:03 ` [PATCH 45/36] xfs_scrub: rename confusing structure Darrick J. Wong
2019-04-04 16:40   ` Eric Sandeen
2019-04-04 16:56     ` Darrick J. Wong
2019-04-04 17:10   ` Darrick J. Wong [this message]
2019-04-12 19:22     ` [PATCH v2 " Eric Sandeen
2019-03-20 20:04 ` [PATCH 46/36] xfs_scrub: remove pointless xfs_verify_error_info struct Darrick J. Wong
2019-04-04 16:47   ` Eric Sandeen
2019-04-04 17:10   ` [PATCH v2 " Darrick J. Wong
2019-04-12 19:23     ` Eric Sandeen
2019-04-12 19:32       ` Darrick J. Wong
2019-03-20 20:05 ` [PATCH 47/36] xfs_scrub: remove xfs_ prefixes from structure names Darrick J. Wong
2019-04-04 16:49   ` Eric Sandeen
2019-03-26 17:18 ` [PATCH 48/36] mkfs: don't use DIFLAG values for fsx_xflags Darrick J. Wong
2019-04-04 16:38   ` Eric Sandeen
2019-04-01 16:43 ` [PATCH 49/36] xfs_scrub: remove redundant function declarations Darrick J. Wong
2019-04-04 16:33   ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190404171023.GQ5147@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox