engines/libaio: don't sleep for 0 reap return for 0 event check
[fio.git] / engines / libaio.c
index 0e2263a743ad657244cc61a5a97ba0ba1b5d2e9a..dae2a70b2c86ea8f8368d97bb680eaccf8d73862 100644 (file)
@@ -169,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);
@@ -177,8 +178,8 @@ static int fio_libaio_getevents(struct thread_data *td, unsigned int min,
        return r < 0 ? r : events;
 }
 
-static enum fio_q_status
-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;