Add option to select how to service multiple files
Right now we just round robin the open files, but sometimes you
just want to randomly go through the files. Add a 'file_service'
option for that, default to round robin still.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/fio.h b/fio.h
index 959e52f..8c46b3f 100644
--- a/fio.h
+++ b/fio.h
@@ -280,7 +280,10 @@
struct fio_file *files;
unsigned int nr_files;
unsigned int nr_uniq_files;
- unsigned int next_file;
+ union {
+ unsigned int next_file;
+ os_random_state_t next_file_state;
+ };
int error;
pid_t pid;
char *orig_buffer;
@@ -340,6 +343,7 @@
unsigned int rwmixread;
unsigned int rwmixwrite;
unsigned int nice;
+ unsigned int file_service_type;
char *read_iolog_file;
char *write_iolog_file;
@@ -437,6 +441,14 @@
};
/*
+ * roundrobin available files, or choose one at random.
+ */
+enum {
+ FIO_FSERVICE_RANDOM = 1,
+ FIO_FSERVICE_RR = 2,
+};
+
+/*
* 30 second per-io_u timeout, with 5 second intervals to avoid resetting
* the timer on each queue operation.
*/