From: Jens Axboe Date: Tue, 8 Jan 2019 17:26:19 +0000 (-0700) Subject: engines/io_uring: ensure to use the right opcode for fixed buffers X-Git-Tag: fio-3.13~48 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=cfcc8564b9a448f3e6b7607c22bf899afb608b1c;p=fio.git engines/io_uring: ensure to use the right opcode for fixed buffers Signed-off-by: Jens Axboe --- diff --git a/engines/io_uring.c b/engines/io_uring.c index e051086b..55f48eda 100644 --- a/engines/io_uring.c +++ b/engines/io_uring.c @@ -149,6 +149,7 @@ static int io_uring_enter(struct ioring_data *ld, unsigned int to_submit, static int fio_ioring_prep(struct thread_data *td, struct io_u *io_u) { struct ioring_data *ld = td->io_ops_data; + struct ioring_options *o = td->eo; struct fio_file *f = io_u->file; struct io_uring_iocb *iocb; @@ -158,10 +159,17 @@ static int fio_ioring_prep(struct thread_data *td, struct io_u *io_u) iocb->ioprio = 0; if (io_u->ddir == DDIR_READ || io_u->ddir == DDIR_WRITE) { - if (io_u->ddir == DDIR_READ) - iocb->opcode = IORING_OP_READ; - else - iocb->opcode = IORING_OP_WRITE; + if (io_u->ddir == DDIR_READ) { + if (o->fixedbufs) + iocb->opcode = IORING_OP_READ_FIXED; + else + iocb->opcode = IORING_OP_READ; + } else { + if (o->fixedbufs) + iocb->opcode = IORING_OP_WRITE_FIXED; + else + iocb->opcode = IORING_OP_WRITE; + } iocb->off = io_u->offset; iocb->addr = io_u->xfer_buf; iocb->len = io_u->xfer_buflen;