Speedup init_disk_util() when dealing with many jobs
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index 53e57b4ffe4a6bcc51907c54ac25ca2531c73d1a..ede61a8eae32dfcd34bc5b9022b99f2b05eaad3b 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -211,6 +211,9 @@ void requeue_io_u(struct thread_data *td, struct io_u **io_u)
 {
        struct io_u *__io_u = *io_u;
 
+       __io_u->flags |= IO_U_F_FREE;
+       __io_u->flags &= ~IO_U_F_FLIGHT;
+
        list_del(&__io_u->list);
        list_add_tail(&__io_u->list, &td->io_u_requeues);
        td->cur_depth--;
@@ -569,13 +572,7 @@ long io_u_queued_complete(struct thread_data *td, int min_events)
        struct timespec *tvp = NULL;
        int ret;
 
-       if (min_events > 0) {
-               ret = td_io_commit(td);
-               if (ret < 0) {
-                       td_verror(td, -ret, "td_io_commit");
-                       return ret;
-               }
-       } else {
+       if (!min_events) {
                struct timespec ts = { .tv_sec = 0, .tv_nsec = 0, };
 
                tvp = &ts;