summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-08-30 10:04:44 -0600
committerJens Axboe <axboe@kernel.dk>2019-08-30 10:04:44 -0600
commitebdbb71160e970af187060dc4bf661af2e5b93b5 (patch)
tree5f3dcbd861c99b2f97cd4eb738af0a896a811a4a
parent1ed37c52144de555e761500084dbffe24fede1c9 (diff)
downloadliburing-ebdbb71160e970af187060dc4bf661af2e5b93b5.tar.gz
liburing-ebdbb71160e970af187060dc4bf661af2e5b93b5.tar.bz2
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 <axboe@kernel.dk>
-rw-r--r--src/include/liburing.h6
1 files 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,