From: Jens Axboe Date: Tue, 13 Mar 2007 11:51:40 +0000 (+0100) Subject: Init stat for all files, not just current range X-Git-Tag: fio-1.14~17 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=7b4e4fe5e6fa26f82f9169c18ec70c08d0805ca9 Init stat for all files, not just current range Signed-off-by: Jens Axboe --- diff --git a/filesetup.c b/filesetup.c index 4beb06e3..c1107a42 100644 --- a/filesetup.c +++ b/filesetup.c @@ -436,7 +436,7 @@ static void get_file_type(struct fio_file *f) void add_file(struct thread_data *td, const char *fname) { - int cur_files = td->open_files; + int cur_files = td->files_index; struct fio_file *f; td->files = realloc(td->files, (cur_files + 1) * sizeof(*f)); @@ -448,7 +448,7 @@ void add_file(struct thread_data *td, const char *fname) get_file_type(f); - td->open_files++; + td->files_index++; if (f->filetype == FIO_TYPE_FILE) td->nr_normal_files++; } diff --git a/fio.h b/fio.h index 3e8b2d2a..465053ac 100644 --- a/fio.h +++ b/fio.h @@ -323,6 +323,7 @@ struct thread_data { int groupid; struct thread_stat ts; struct fio_file *files; + unsigned int files_index; unsigned int nr_files; unsigned int nr_open_files; unsigned int nr_normal_files; @@ -775,6 +776,8 @@ extern void close_ioengine(struct thread_data *); 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)->open_files; (i)++, (f)++) +#define for_all_files(td, f, i) \ + for ((i) = 0, (f) = &(td)->files[0]; (i) < (td)->files_index; (i)++, (f)++) #define fio_assert(td, cond) do { \ if (!(cond)) { \ diff --git a/stat.c b/stat.c index 815e3ae5..ed1db7c9 100644 --- a/stat.c +++ b/stat.c @@ -317,7 +317,7 @@ void init_disk_util(struct thread_data *td) (td->io_ops->flags & (FIO_DISKLESSIO | FIO_NODISKUTIL))) return; - for_each_file(td, f, i) + for_all_files(td, f, i) __init_disk_util(td, f); }