engines/libaio: set IOCB_HIPRI if we are polling
authorJens Axboe <axboe@kernel.dk>
Sat, 1 Dec 2018 17:17:26 +0000 (10:17 -0700)
committerJens Axboe <axboe@kernel.dk>
Sat, 1 Dec 2018 17:17:26 +0000 (10:17 -0700)
Forgot to set it for the non-user mapped case.

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

index 9c8a61b7a121e411bf0e6bcc585491fc49789a39..a780b2b8a42bdf1e44c18a23463c2a6c77282c96 100644 (file)
@@ -130,15 +130,21 @@ static int fio_libaio_prep(struct thread_data fio_unused *td, struct io_u *io_u)
                        iocb->aio_fildes = f->fd;
                        iocb->aio_lio_opcode = IO_CMD_PREAD;
                        iocb->u.c.offset = io_u->offset;
                        iocb->aio_fildes = f->fd;
                        iocb->aio_lio_opcode = IO_CMD_PREAD;
                        iocb->u.c.offset = io_u->offset;
-               } else
+               } else {
                        io_prep_pread(iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset);
                        io_prep_pread(iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset);
+                       if (o->hipri)
+                               iocb->u.c.flags |= IOCB_FLAG_HIPRI;
+               }
        } else if (io_u->ddir == DDIR_WRITE) {
                if (o->fixedbufs) {
                        iocb->aio_fildes = f->fd;
                        iocb->aio_lio_opcode = IO_CMD_PWRITE;
                        iocb->u.c.offset = io_u->offset;
        } else if (io_u->ddir == DDIR_WRITE) {
                if (o->fixedbufs) {
                        iocb->aio_fildes = f->fd;
                        iocb->aio_lio_opcode = IO_CMD_PWRITE;
                        iocb->u.c.offset = io_u->offset;
-               } else
+               } else {
                        io_prep_pwrite(iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset);
                        io_prep_pwrite(iocb, f->fd, io_u->xfer_buf, io_u->xfer_buflen, io_u->offset);
+                       if (o->hipri)
+                               iocb->u.c.flags |= IOCB_FLAG_HIPRI;
+               }
        } else if (ddir_sync(io_u->ddir))
                io_prep_fsync(iocb, f->fd);
 
        } else if (ddir_sync(io_u->ddir))
                io_prep_fsync(iocb, f->fd);