Fix invalidate cache typo
[fio.git] / ioengines.c
index a7ccad66f810b982b7a0d15b355aa6efcbde0334..9d7453bafcaef77ce32b64d76d99c5d033600555 100644 (file)
@@ -195,6 +195,9 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u)
        assert((io_u->flags & IO_U_F_FLIGHT) == 0);
        io_u->flags |= IO_U_F_FLIGHT;
 
+       io_u->error = 0;
+       io_u->resid = 0;
+
        if (td->io_ops->flags & FIO_SYNCIO) {
                fio_gettime(&io_u->issue_time, NULL);
 
@@ -254,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--;
+}