From 4ace28d7b4579237159893ab626ce029c63a8ccb Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Wed, 17 Oct 2018 13:25:11 -0500 Subject: [PATCH] xfs_scrub: remove shadow var from run_scrub_phases() The local nr_threads shadows a global var of the same name. Use a local variable to avoid confusion (even though estimate_work() may simply fill in the value of the global...) Signed-off-by: Eric Sandeen Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Eric Sandeen --- scrub/xfs_scrub.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c index 33b83a5fc..a789b6f4c 100644 --- a/scrub/xfs_scrub.c +++ b/scrub/xfs_scrub.c @@ -422,7 +422,6 @@ run_scrub_phases( bool moveon = true; unsigned int debug_phase = 0; unsigned int phase; - unsigned int nr_threads; int rshift; if (debug_tweak_on("XFS_SCRUB_PHASE")) @@ -454,12 +453,14 @@ run_scrub_phases( if (!moveon) break; if (sp->estimate_work) { - moveon = sp->estimate_work(ctx, &max_work, &nr_threads, - &rshift); + unsigned int work_threads; + + moveon = sp->estimate_work(ctx, &max_work, + &work_threads, &rshift); if (!moveon) break; moveon = progress_init_phase(ctx, progress_fp, phase, - max_work, rshift, nr_threads); + max_work, rshift, work_threads); } else { moveon = progress_init_phase(ctx, NULL, phase, 0, 0, 0); } -- 2.39.2