From ebdbb71160e970af187060dc4bf661af2e5b93b5 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 30 Aug 2019 10:04:44 -0600 Subject: Fixed address prep helpers should include buf_index io_uring depends on the caller specifying the index into the array of registered buffers for doing pre-mapped IO. Make this explicit by requiring the caller to pass in this value for the io_uring_prep_read_fixed() and io_uring_prep_write_fixed() helpers. Signed-off-by: Jens Axboe --- src/include/liburing.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/include/liburing.h b/src/include/liburing.h index 7d7c9df..7d884c9 100644 --- a/src/include/liburing.h +++ b/src/include/liburing.h @@ -166,9 +166,10 @@ static inline void io_uring_prep_readv(struct io_uring_sqe *sqe, int fd, static inline void io_uring_prep_read_fixed(struct io_uring_sqe *sqe, int fd, void *buf, unsigned nbytes, - off_t offset) + off_t offset, int buf_index) { io_uring_prep_rw(IORING_OP_READ_FIXED, sqe, fd, buf, nbytes, offset); + sqe->buf_index = buf_index; } static inline void io_uring_prep_writev(struct io_uring_sqe *sqe, int fd, @@ -180,9 +181,10 @@ static inline void io_uring_prep_writev(struct io_uring_sqe *sqe, int fd, static inline void io_uring_prep_write_fixed(struct io_uring_sqe *sqe, int fd, const void *buf, unsigned nbytes, - off_t offset) + off_t offset, int buf_index) { io_uring_prep_rw(IORING_OP_WRITE_FIXED, sqe, fd, buf, nbytes, offset); + sqe->buf_index = buf_index; } static inline void io_uring_prep_poll_add(struct io_uring_sqe *sqe, int fd, -- cgit