Get rid of this global variable since we already have a libfrog function
that does exactly what it 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>
#include "xfs_scrub.h"
#include "common.h"
#include "disk.h"
+#include "platform_defs.h"
#ifndef BLKROTATIONAL
# define BLKROTATIONAL _IO(0x12, 126)
{
int iomin;
int ioopt;
+ int nproc = platform_nproc();
unsigned short rot;
int error;
/* Background mode; higher values insert more pauses between scrub calls. */
unsigned int bg_mode;
-/* Maximum number of processors available to us. */
-int nproc;
-
/* Number of threads we're allowed to use. */
unsigned int force_nr_threads;
}
memcpy(&ctx.fsinfo, fsp, sizeof(struct fs_path));
- /* How many CPUs? */
- nproc = sysconf(_SC_NPROCESSORS_ONLN);
- if (nproc < 1)
- nproc = 1;
-
/* Set up a page-aligned buffer for read verification. */
page_size = sysconf(_SC_PAGESIZE);
if (page_size < 0) {
extern unsigned int force_nr_threads;
extern unsigned int bg_mode;
extern unsigned int debug;
-extern int nproc;
extern bool verbose;
extern long page_size;
extern bool want_fstrim;