r = blockdev_size(f->fd, &bytes);
if (r) {
td_verror(td, r, "blockdev_size");
+ printf("fd is %d\n", f->fd);
goto err;
}
}
f->fd = -1;
+ fio_file_reset(f);
if (td->files_size <= td->files_index) {
int new_size = td->o.nr_files + 1;
return cur_files;
}
+int add_file_exclusive(struct thread_data *td, const char *fname)
+{
+ struct fio_file *f;
+ unsigned int i;
+
+ for_each_file(td, f, i) {
+ if (!strcmp(f->file_name, fname))
+ return i;
+ }
+
+ return add_file(td, fname);
+}
+
void get_file(struct fio_file *f)
{
dprint(FD_FILE, "get file %s, ref=%d\n", f->file_name, f->references);
assert(0);
}
__f->fd = -1;
+ fio_file_reset(__f);
if (f->file_name) {
__f->file_name = smalloc_strdup(f->file_name);