if (td->iodepth_batch > td->iodepth || !td->iodepth_batch)
td->iodepth_batch = td->iodepth;
- if (td->open_files > td->nr_files || !td->open_files)
+ if (!td->nr_files)
+ td->nr_files = td->open_files;
+ else if (td->open_files > td->nr_files || !td->open_files)
td->open_files = td->nr_files;
}
static int str_filename_cb(void *data, const char *input)
{
struct thread_data *td = data;
- char *fname, *str;
+ char *fname, *str, *p;
- str = strdup(input);
- while ((fname = strsep(&str, ":")) != NULL)
+ td->nr_files = 0;
+ p = str = strdup(input);
+ while ((fname = strsep(&str, ":")) != NULL) {
add_file(td, fname);
+ td->nr_files++;
+ }
+ free(p);
return 0;
}