td->iodepth_batch = td->iodepth;
if (!td->nr_files)
- td->nr_files = td->open_files;
- else if (td->open_files > td->nr_files || !td->open_files)
+ td->nr_files = td->files_index;
+ else if (td->nr_files > td->files_index)
+ td->nr_files = td->files_index;
+
+ if (td->open_files > td->nr_files || !td->open_files)
td->open_files = td->nr_files;
}
if (!td->filename) {
td->filename = strdup(jobname);
- for (i = 0; i < td->nr_files; i++) {
- sprintf(fname, "%s.%d.%d", td->filename, td->thread_number, i);
- add_file(td, fname);
+ if (td->nr_files == 1)
+ add_file(td, td->filename);
+ else {
+ for (i = 0; i < td->nr_files; i++) {
+ sprintf(fname, "%s.%d.%d", td->filename, td->thread_number, i);
+ add_file(td, fname);
+ }
}
}
sprintf(fname, "%s/%s", td->directory, f->file_name);
f->file_name = strdup(fname);
}
-
- f->file_size = td->total_file_size / td->nr_files;
- f->file_offset = td->start_offset;
}
td->mutex = fio_sem_init(0);
struct thread_data *td = data;
char *fname, *str, *p;
- td->nr_files = 0;
p = str = strdup(input);
+
+ strip_blank_front(&str);
+ strip_blank_end(str);
+
while ((fname = strsep(&str, ":")) != NULL) {
+ if (!strlen(fname))
+ break;
add_file(td, fname);
- td->nr_files++;
}
free(p);