Add sub-option support (sort-of) and convert libaio_userspace_reap
[fio.git] / engines / libaio.c
index ea05c63c689b43de1f18116a1c04c62bf5af12a6..ad34d065a3c3bb5cea63e97963a6a3609cd44707 100644 (file)
@@ -63,7 +63,7 @@ struct aio_ring {
        unsigned nr;             /** number of io_events */
        unsigned head;
        unsigned tail;
+
        unsigned magic;
        unsigned compat_features;
        unsigned incompat_features;
@@ -75,11 +75,11 @@ struct aio_ring {
 #define AIO_RING_MAGIC 0xa10a10a1
 
 static int user_io_getevents(io_context_t aio_ctx, unsigned int max,
-                       struct io_event *events)
+                            struct io_event *events)
 {
        long i = 0;
        unsigned head;
-       struct aio_ring *ring = (struct aio_ring*)aio_ctx;
+       struct aio_ring *ring = (struct aio_ring*) aio_ctx;
 
        while (i < max) {
                head = ring->head;
@@ -91,7 +91,7 @@ static int user_io_getevents(io_context_t aio_ctx, unsigned int max,
                        /* There is another completion to reap */
                        events[i] = ring->events[head];
                        read_barrier();
-                       ring->head = (head + 1) % ring->nr;
+                       ring->head = (head + 1) % ring->nr;
                        i++;
                }
        }