Make file structures dynamically allocated
Current td->files is an array of files, make it an array of pointers
instead and allocate individual file structures on the fly. This is
a preparation patch for file sharing.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/fio.h b/fio.h
index 9281934..ca35ffc 100644
--- a/fio.h
+++ b/fio.h
@@ -498,7 +498,7 @@
int thread_number;
int groupid;
struct thread_stat ts;
- struct fio_file *files;
+ struct fio_file **files;
unsigned int files_index;
unsigned int nr_open_files;
unsigned int nr_done_files;
@@ -941,7 +941,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) < (td)->o.nr_files; (i)++, (f)++)
+ for ((i) = 0, (f) = (td)->files[0]; (i) < (td)->o.nr_files; (i)++, (f)++)
#define fio_assert(td, cond) do { \
if (!(cond)) { \