Make nr_thread/nr_process private to backend
No need export that knowledge. Merge from gfio.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/backend.c b/backend.c
index 5f862ab..9438ffd 100644
--- a/backend.c
+++ b/backend.c
@@ -61,14 +61,14 @@
static char *cgroup_mnt;
static int exit_value;
static volatile int fio_abort;
+static unsigned int nr_process = 0;
+static unsigned int nr_thread = 0;
struct io_log *agg_io_log[DDIR_RWDIR_CNT];
int groupid = 0;
unsigned int thread_number = 0;
unsigned int stat_number = 0;
-unsigned int nr_process = 0;
-unsigned int nr_thread = 0;
int shm_id = 0;
int temp_stall_ts;
unsigned long done_secs = 0;
@@ -1558,6 +1558,14 @@
set_sig_handlers();
+ nr_thread = nr_process = 0;
+ for_each_td(td, i) {
+ if (td->o.use_thread)
+ nr_thread++;
+ else
+ nr_process++;
+ }
+
if (output_format == FIO_OUTPUT_NORMAL) {
log_info("Starting ");
if (nr_thread)
diff --git a/fio.h b/fio.h
index 04a9a9a..67d13c2 100644
--- a/fio.h
+++ b/fio.h
@@ -345,7 +345,6 @@
extern int exitall_on_terminate;
extern unsigned int thread_number;
extern unsigned int stat_number;
-extern unsigned int nr_process, nr_thread;
extern int shm_id;
extern int groupid;
extern int output_format;
diff --git a/init.c b/init.c
index 9e2d113..7a92842 100644
--- a/init.c
+++ b/init.c
@@ -919,11 +919,6 @@
if (ioengine_load(td))
goto err;
- if (o->use_thread)
- nr_thread++;
- else
- nr_process++;
-
if (o->odirect)
td->io_ops->flags |= FIO_RAWIO;
diff --git a/libfio.c b/libfio.c
index f7f1326..c26d6a3 100644
--- a/libfio.c
+++ b/libfio.c
@@ -140,8 +140,6 @@
groupid = 0;
thread_number = 0;
stat_number = 0;
- nr_process = 0;
- nr_thread = 0;
done_secs = 0;
}