Add sqe prep helpers

Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe
2019-01-17 18:12:22 -07:00
parent 980cc0f025
commit 5789a6351a
5 changed files with 67 additions and 49 deletions

View File

@@ -54,14 +54,7 @@ int main(int argc, char *argv[])
sqe = io_uring_get_sqe(&ring);
if (!sqe)
break;
sqe->opcode = IORING_OP_READV;
sqe->flags = 0;
sqe->ioprio = 0;
sqe->fd = fd;
sqe->off = offset;
sqe->addr = (unsigned long) &iovecs[i];
sqe->len = 1;
sqe->buf_index = 0;
io_uring_prep_readv(sqe, fd, &iovecs[i], 1, offset);
offset += iovecs[i].iov_len;
} while (1);