Use the correct opcode when for reads and writes using the fixedbuf
option, otherwise EINVAL errors will be returned to these requests.
Fixes:
b10b1e70a ("io_uring: add option for non-vectored read/write commands")
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
{ IORING_OP_WRITEV, IORING_OP_WRITE }
};
{ IORING_OP_WRITEV, IORING_OP_WRITE }
};
+static const int fixed_ddir_to_op[2] = {
+ IORING_OP_READ_FIXED,
+ IORING_OP_WRITE_FIXED
+};
+
static int fio_ioring_sqpoll_cb(void *data, unsigned long long *val)
{
struct ioring_options *o = data;
static int fio_ioring_sqpoll_cb(void *data, unsigned long long *val)
{
struct ioring_options *o = data;
}
if (io_u->ddir == DDIR_READ || io_u->ddir == DDIR_WRITE) {
}
if (io_u->ddir == DDIR_READ || io_u->ddir == DDIR_WRITE) {
- sqe->opcode = ddir_to_op[io_u->ddir][!!o->nonvectored];
+ sqe->opcode = fixed_ddir_to_op[io_u->ddir];
sqe->addr = (unsigned long) io_u->xfer_buf;
sqe->len = io_u->xfer_buflen;
sqe->buf_index = io_u->index;
} else {
sqe->addr = (unsigned long) io_u->xfer_buf;
sqe->len = io_u->xfer_buflen;
sqe->buf_index = io_u->index;
} else {
+ sqe->opcode = ddir_to_op[io_u->ddir][!!o->nonvectored];
if (o->nonvectored) {
sqe->addr = (unsigned long)
ld->iovecs[io_u->index].iov_base;
if (o->nonvectored) {
sqe->addr = (unsigned long)
ld->iovecs[io_u->index].iov_base;