Rename example job files (*.job -> *.fio)
[fio.git] / engines / libaio.c
index e0d7cbbafb780551f35c62c83bb9dd3b26b4b164..7ac36b236cdf91a33f31ff738176d0fadd8c4235 100644 (file)
@@ -4,11 +4,9 @@
  * IO engine using the Linux native aio interface.
  *
  */
-#include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
-#include <assert.h>
 #include <libaio.h>
 
 #include "../fio.h"
@@ -171,7 +169,8 @@ static int fio_libaio_getevents(struct thread_data *td, unsigned int min,
                        events += r;
                else if ((min && r == 0) || r == -EAGAIN) {
                        fio_libaio_commit(td);
-                       usleep(100);
+                       if (actual_min)
+                               usleep(10);
                } else if (r != -EINTR)
                        break;
        } while (events < min);
@@ -179,7 +178,8 @@ static int fio_libaio_getevents(struct thread_data *td, unsigned int min,
        return r < 0 ? r : events;
 }
 
-static int fio_libaio_queue(struct thread_data *td, struct io_u *io_u)
+static enum fio_q_status fio_libaio_queue(struct thread_data *td,
+                                         struct io_u *io_u)
 {
        struct libaio_data *ld = td->io_ops_data;
 
@@ -207,6 +207,8 @@ static int fio_libaio_queue(struct thread_data *td, struct io_u *io_u)
                        return FIO_Q_BUSY;
 
                do_io_u_trim(td, io_u);
+               io_u_mark_submit(td, 1);
+               io_u_mark_complete(td, 1);
                return FIO_Q_COMPLETED;
        }