aioring: update API
authorJens Axboe <axboe@kernel.dk>
Sun, 30 Dec 2018 23:40:09 +0000 (16:40 -0700)
committerJens Axboe <axboe@kernel.dk>
Sun, 30 Dec 2018 23:40:09 +0000 (16:40 -0700)
Both the engine and t/aio-ring, drop IORING_FLAG_SUBMIT as it's
been dropped on the kernel side. Renumber IORING_FLAG_GETEVENTS.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/aioring.c
t/aio-ring.c

index 50826964ff73af18e96b97a41963714da8e7abc9..88641a93813807799b36ef2436cd48919ea9e8d0 100644 (file)
 /*
  * io_ring_enter(2) flags
  */
 /*
  * io_ring_enter(2) flags
  */
-#ifndef IORING_FLAG_SUBMIT
-#define IORING_FLAG_SUBMIT     (1 << 0)
-#endif
 #ifndef IORING_FLAG_GETEVENTS
 #ifndef IORING_FLAG_GETEVENTS
-#define IORING_FLAG_GETEVENTS  (1 << 1)
+#define IORING_FLAG_GETEVENTS  (1 << 0)
 #endif
 
 typedef uint64_t u64;
 #endif
 
 typedef uint64_t u64;
@@ -377,7 +374,7 @@ static int fio_aioring_commit(struct thread_data *td)
                struct aio_sq_ring *ring = ld->sq_ring;
 
                if (ring->kflags & IORING_SQ_NEED_WAKEUP)
                struct aio_sq_ring *ring = ld->sq_ring;
 
                if (ring->kflags & IORING_SQ_NEED_WAKEUP)
-                       io_ring_enter(ld->aio_ctx, ld->queued, 0, IORING_FLAG_SUBMIT);
+                       io_ring_enter(ld->aio_ctx, ld->queued, 0, 0);
                ld->queued = 0;
                return 0;
        }
                ld->queued = 0;
                return 0;
        }
@@ -386,8 +383,7 @@ static int fio_aioring_commit(struct thread_data *td)
                unsigned start = ld->sq_ring->head;
                long nr = ld->queued;
 
                unsigned start = ld->sq_ring->head;
                long nr = ld->queued;
 
-               ret = io_ring_enter(ld->aio_ctx, nr, 0, IORING_FLAG_SUBMIT |
-                                               IORING_FLAG_GETEVENTS);
+               ret = io_ring_enter(ld->aio_ctx, nr, 0, IORING_FLAG_GETEVENTS);
                if (ret > 0) {
                        fio_aioring_queued(td, start, ret);
                        io_u_mark_submit(td, ret);
                if (ret > 0) {
                        fio_aioring_queued(td, start, ret);
                        io_u_mark_submit(td, ret);
index 900f4640c6bba3d6c2cdb22f31ed4ba738581b03..2fd7ac61c818d20933a9a59a3fe9085aa27af6dc 100644 (file)
@@ -66,8 +66,7 @@ struct aio_cq_ring {
        struct io_event events[0];
 };
 
        struct io_event events[0];
 };
 
-#define IORING_FLAG_SUBMIT     (1 << 0)
-#define IORING_FLAG_GETEVENTS  (1 << 1)
+#define IORING_FLAG_GETEVENTS  (1 << 0)
 
 #define DEPTH                  32
 
 
 #define DEPTH                  32
 
@@ -254,7 +253,7 @@ static void *submitter_fn(void *data)
 
        prepped = 0;
        do {
 
        prepped = 0;
        do {
-               int to_wait, flags, to_submit, this_reap;
+               int to_wait, to_submit, this_reap;
 
                if (!prepped && s->inflight < DEPTH)
                        prepped = prep_more_ios(s, fd, min(DEPTH - s->inflight, BATCH_SUBMIT));
 
                if (!prepped && s->inflight < DEPTH)
                        prepped = prep_more_ios(s, fd, min(DEPTH - s->inflight, BATCH_SUBMIT));
@@ -267,11 +266,8 @@ submit:
                else
                        to_wait = min(s->inflight + to_submit, BATCH_COMPLETE);
 
                else
                        to_wait = min(s->inflight + to_submit, BATCH_COMPLETE);
 
-               flags = IORING_FLAG_GETEVENTS;
-               if (to_submit)
-                       flags |= IORING_FLAG_SUBMIT;
-
-               ret = io_ring_enter(s->ioc, to_submit, to_wait, flags);
+               ret = io_ring_enter(s->ioc, to_submit, to_wait,
+                                       IORING_FLAG_GETEVENTS);
                s->calls++;
 
                this_reap = reap_events(s);
                s->calls++;
 
                this_reap = reap_events(s);