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>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
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;
}
disk_heads(
struct disk *disk)
{
- if (nr_threads)
- return nr_threads;
+ if (force_nr_threads)
+ return force_nr_threads;
return __disk_heads(disk);
}
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;
}
break;
case 'b':
- nr_threads = 1;
+ force_nr_threads = 1;
bg_mode++;
break;
case 'C':
perror("nr_threads");
usage();
}
- nr_threads = x;
+ force_nr_threads = x;
}
if (optind != argc - 1)
#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;