All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@redhat.com, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 3/8] xfs_scrub: rename the global nr_threads
Date: Wed, 19 Dec 2018 11:29:43 -0800	[thread overview]
Message-ID: <154524778320.28646.6335728310849649280.stgit@magnolia> (raw)
In-Reply-To: <154524776457.28646.3004453037075812416.stgit@magnolia>

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

Various functions have nr_threads local variables that shadow the global
one.  Since the global one forces the number of threads we use, change
its name to remove this ambiguity and reflect what it really does.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 scrub/common.c    |    4 ++--
 scrub/disk.c      |    4 ++--
 scrub/xfs_scrub.c |    6 +++---
 scrub/xfs_scrub.h |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)


diff --git a/scrub/common.c b/scrub/common.c
index 78afc4bf..c877c7c8 100644
--- a/scrub/common.c
+++ b/scrub/common.c
@@ -231,8 +231,8 @@ unsigned int
 scrub_nproc(
 	struct scrub_ctx	*ctx)
 {
-	if (nr_threads)
-		return nr_threads;
+	if (force_nr_threads)
+		return force_nr_threads;
 	return ctx->nr_io_threads;
 }
 
diff --git a/scrub/disk.c b/scrub/disk.c
index 7daa508e..dd109533 100644
--- a/scrub/disk.c
+++ b/scrub/disk.c
@@ -75,8 +75,8 @@ unsigned int
 disk_heads(
 	struct disk		*disk)
 {
-	if (nr_threads)
-		return nr_threads;
+	if (force_nr_threads)
+		return force_nr_threads;
 	return __disk_heads(disk);
 }
 
diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c
index b8138000..71fc274f 100644
--- a/scrub/xfs_scrub.c
+++ b/scrub/xfs_scrub.c
@@ -133,7 +133,7 @@ unsigned int			bg_mode;
 int				nproc;
 
 /* Number of threads we're allowed to use. */
-unsigned int			nr_threads;
+unsigned int			force_nr_threads;
 
 /* Verbosity; higher values print more information. */
 bool				verbose;
@@ -589,7 +589,7 @@ main(
 			}
 			break;
 		case 'b':
-			nr_threads = 1;
+			force_nr_threads = 1;
 			bg_mode++;
 			break;
 		case 'C':
@@ -659,7 +659,7 @@ main(
 			perror("nr_threads");
 			usage();
 		}
-		nr_threads = x;
+		force_nr_threads = x;
 	}
 
 	if (optind != argc - 1)
diff --git a/scrub/xfs_scrub.h b/scrub/xfs_scrub.h
index a961d8fd..a459e4b5 100644
--- a/scrub/xfs_scrub.h
+++ b/scrub/xfs_scrub.h
@@ -10,7 +10,7 @@ extern char *progname;
 
 #define _PATH_PROC_MOUNTS	"/proc/mounts"
 
-extern unsigned int		nr_threads;
+extern unsigned int		force_nr_threads;
 extern unsigned int		bg_mode;
 extern unsigned int		debug;
 extern int			nproc;

  parent reply	other threads:[~2018-12-19 19:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-19 19:29 [PATCH 0/8] xfsprogs: various fixes Darrick J. Wong
2018-12-19 19:29 ` [PATCH 1/8] xfs_scrub_all: walk the lsblk device/fs hierarchy correctly Darrick J. Wong
2019-02-04 18:08   ` Eric Sandeen
2019-02-04 18:16     ` Darrick J. Wong
2019-02-04 18:27       ` Eric Sandeen
2018-12-19 19:29 ` [PATCH 2/8] xfs_scrub_all.timer: activate after most of the system is up Darrick J. Wong
2019-02-04 18:12   ` Eric Sandeen
2018-12-19 19:29 ` Darrick J. Wong [this message]
2019-02-04 18:20   ` [PATCH 3/8] xfs_scrub: rename the global nr_threads Eric Sandeen
2018-12-19 19:29 ` [PATCH 4/8] xfs_scrub: use datadev parallelization estimates for thread count Darrick J. Wong
2019-02-04 18:31   ` Eric Sandeen
2019-02-04 18:34     ` Darrick J. Wong
2018-12-19 19:30 ` [PATCH 5/8] xfs_scrub: use data/rtdev parallelization estimates for the read-verify pool Darrick J. Wong
2019-02-04 18:35   ` Eric Sandeen
2019-02-04 18:38     ` Darrick J. Wong
2019-02-05  2:23       ` Darrick J. Wong
2018-12-19 19:30 ` [PATCH 6/8] xfs_repair: reinitialize the root directory nlink correctly Darrick J. Wong
2018-12-19 20:24   ` Bill O'Donnell
2019-02-04 19:19   ` Eric Sandeen
2018-12-19 19:30 ` [PATCH 7/8] xfs_repair: bump the irec on-disk nlink when adding lost+found Darrick J. Wong
2018-12-19 20:30   ` Bill O'Donnell
2018-12-19 19:30 ` [PATCH 8/8] xfs_repair: fix uninitialized variable warnings Darrick J. Wong
2018-12-19 20:25   ` Bill O'Donnell

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=154524778320.28646.6335728310849649280.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.