Revamp file open/close handling
[fio.git] / ioengines.c
index a395da15a95c113fb241981eb84b1fc32c009fd0..9d7453bafcaef77ce32b64d76d99c5d033600555 100644 (file)
@@ -257,3 +257,20 @@ int td_io_commit(struct thread_data *td)
 
        return 0;
 }
+
+int td_io_open_file(struct thread_data *td, struct fio_file *f)
+{
+       if (!td->io_ops->open_file(td, f)) {
+               td->nr_open_files++;
+               return 0;
+       }
+
+       return 1;
+}
+
+void td_io_close_file(struct thread_data *td, struct fio_file *f)
+{
+       if (td->io_ops->close_file)
+               td->io_ops->close_file(td, f);
+       td->nr_open_files--;
+}