binject: fix missing includes for stat(2)
[fio.git] / filesetup.c
index d2b74d7f6a60fd7a5adece91a8445bb9ad696bde..ae893c7b178ecf4ab3080afd70095a3af2c97e2e 100644 (file)
@@ -244,6 +244,7 @@ static int bdev_size(struct thread_data *td, struct fio_file *f)
        r = blockdev_size(f->fd, &bytes);
        if (r) {
                td_verror(td, r, "blockdev_size");
+               printf("fd is %d\n", f->fd);
                goto err;
        }
 
@@ -963,6 +964,19 @@ int add_file(struct thread_data *td, const char *fname)
        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);