libaio: switch to newer libaio polled IO API
authorJens Axboe <axboe@kernel.dk>
Fri, 16 Nov 2018 03:31:35 +0000 (20:31 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 16 Nov 2018 03:31:35 +0000 (20:31 -0700)
No more new opcodes, just set IOCB_FLAG_HIPRI instead.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/libaio.c

index b241ed99c4972e9956597d355645c65fa8274498..dc664627be73093e5357d13acb9df0a695d5bebc 100644 (file)
@@ -13,8 +13,9 @@
 #include "../lib/pow2.h"
 #include "../optgroup.h"
 
-#define IOCB_CMD_PREAD_POLL 9
-#define IOCB_CMD_PWRITE_POLL 10
+#ifndef IOCB_FLAG_HIPRI
+#define IOCB_FLAG_HIPRI        (1 << 2)
+#endif
 
 static int fio_libaio_commit(struct thread_data *td);
 
@@ -57,7 +58,7 @@ static struct fio_option options[] = {
        },
        {
                .name   = "hipri",
-               .lname  = "RWF_HIPRI",
+               .lname  = "High Priority",
                .type   = FIO_OPT_STR_SET,
                .off1   = offsetof(struct libaio_options, hipri),
                .help   = "Use polled IO completions",
@@ -86,11 +87,11 @@ static int fio_libaio_prep(struct thread_data fio_unused *td, struct io_u *io_u)
        if (io_u->ddir == DDIR_READ) {
                io_prep_pread(&io_u->iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset);
                if (o->hipri)
-                       io_u->iocb.aio_lio_opcode = IOCB_CMD_PREAD_POLL;
+                       io_u->iocb.u.c.flags |= IOCB_FLAG_HIPRI;
        } else if (io_u->ddir == DDIR_WRITE) {
                io_prep_pwrite(&io_u->iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset);
                if (o->hipri)
-                       io_u->iocb.aio_lio_opcode = IOCB_CMD_PWRITE_POLL;
+                       io_u->iocb.u.c.flags |= IOCB_FLAG_HIPRI;
        } else if (ddir_sync(io_u->ddir))
                io_prep_fsync(&io_u->iocb, f->fd);