Otherwise we introduce differences between threads and processes,
we don't want to do that.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
td->files = NULL;
td->o.nr_files = 0;
}
td->files = NULL;
td->o.nr_files = 0;
}
{
return recurse_dir(td, path);
}
{
return recurse_dir(td, path);
}
+
+void dup_files(struct thread_data *td, struct thread_data *org)
+{
+ struct fio_file *f;
+ unsigned int i;
+ size_t bytes;
+
+ if (!org->files)
+ return;
+
+ bytes = org->files_index * sizeof(*f);
+ td->files = malloc(bytes);
+ memcpy(td->files, org->files, bytes);
+
+ for_each_file(td, f, i) {
+ if (f->file_name)
+ f->file_name = strdup(f->file_name);
+ }
+}
extern void put_file(struct thread_data *, struct fio_file *);
extern int add_dir_files(struct thread_data *, const char *);
extern int init_random_map(struct thread_data *);
extern void put_file(struct thread_data *, struct fio_file *);
extern int add_dir_files(struct thread_data *, const char *);
extern int init_random_map(struct thread_data *);
+extern void dup_files(struct thread_data *, struct thread_data *);
td = &threads[thread_number++];
*td = *parent;
td = &threads[thread_number++];
*td = *parent;
+ dup_files(td, parent);
+
td->thread_number = thread_number;
return td;
}
td->thread_number = thread_number;
return td;
}