Track io_u state (free or in-flight)
[fio.git] / ioengines.c
index ab5b2245131fb1abb5d2e6b51a94227522e78991..1704418735367e92e48dfb42f5fb85e0902eed6a 100644 (file)
@@ -14,6 +14,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <dlfcn.h>
+#include <assert.h>
 
 #include "fio.h"
 #include "os.h"
@@ -188,6 +189,9 @@ int td_io_queue(struct thread_data *td, struct io_u *io_u)
 {
        int ret;
 
+       assert((io_u->flags & IO_U_F_FLIGHT) == 0);
+       io_u->flags |= IO_U_F_FLIGHT;
+
        if (td->io_ops->flags & FIO_SYNCIO)
                fio_gettime(&io_u->issue_time, NULL);