]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_scrub: remove shadow var from run_scrub_phases()
authorEric Sandeen <sandeen@redhat.com>
Wed, 17 Oct 2018 18:25:11 +0000 (13:25 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 17 Oct 2018 18:25:11 +0000 (13:25 -0500)
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 <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
scrub/xfs_scrub.c

index 33b83a5fca2d03dfc2028ff91deef387fd4b03b4..a789b6f4cfb1710950766c38f99e509f31fbf210 100644 (file)
@@ -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);
                }