Allow explicit setting of a number of files
We currently only allow filename=foo for one file, add the possibility
to specify any number of files by seperating with a colon.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/fio.h b/fio.h
index 0ca23cc..3b902a8 100644
--- a/fio.h
+++ b/fio.h
@@ -223,6 +223,8 @@
* this structure holds state information for a single file.
*/
struct fio_file {
+ enum fio_filetype filetype;
+
/*
* A file may not be a file descriptor, let the io engine decide
*/
@@ -230,7 +232,7 @@
unsigned long file_data;
int fd;
};
- char *file_name;
+ const char *file_name;
void *mmap;
unsigned long long file_size;
unsigned long long real_file_size;
@@ -314,7 +316,6 @@
int thread_number;
int groupid;
struct thread_stat ts;
- enum fio_filetype filetype;
struct fio_file *files;
unsigned int nr_files;
unsigned int nr_open_files;
@@ -648,6 +649,7 @@
extern int __must_check file_invalidate_cache(struct thread_data *, struct fio_file *);
extern int __must_check generic_open_file(struct thread_data *, struct fio_file *);
extern void generic_close_file(struct thread_data *, struct fio_file *);
+extern void add_file(struct thread_data *, const char *);
/*
* ETA/status stuff
@@ -764,7 +766,7 @@
#define for_each_td(td, i) \
for ((i) = 0, (td) = &threads[0]; (i) < (int) thread_number; (i)++, (td)++)
#define for_each_file(td, f, i) \
- for ((i) = 0, (f) = &(td)->files[0]; (i) < (int) (td)->open_files; (i)++, (f)++)
+ for ((i) = 0, (f) = &(td)->files[0]; (i) < (td)->open_files; (i)++, (f)++)
#define fio_assert(td, cond) do { \
if (!(cond)) { \