summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Gershman <romange@gmail.com>2021-10-21 08:08:30 +0300
committerRoman Gershman <romange@gmail.com>2021-10-21 08:30:36 +0300
commitc1c92fd4600f8a257992a02dc5767abdfc151964 (patch)
treea2d3abd199c75ed7d0cfd3caa90c8f9e9ab8a053
parenta50c471578158b4c5d85cefbdbaed61296159eac (diff)
downloadliburing-c1c92fd4600f8a257992a02dc5767abdfc151964.tar.gz
liburing-c1c92fd4600f8a257992a02dc5767abdfc151964.tar.bz2
Add io_uring_prep_readv2 and io_uring_prep_writev2 helpers
These correspond to preadv2 and pwritev2 calls and include flags argument missing in the original helpers. Signed-off-by: Roman Gershman <romange@gmail.com> Link: https://github.com/axboe/liburing/issues/461
-rw-r--r--src/include/liburing.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 99f4f37..fc81542 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -312,6 +312,14 @@ static inline void io_uring_prep_readv(struct io_uring_sqe *sqe, int fd,
io_uring_prep_rw(IORING_OP_READV, sqe, fd, iovecs, nr_vecs, offset);
}
+static inline void io_uring_prep_readv2(struct io_uring_sqe *sqe, int fd,
+ const struct iovec *iovecs,
+ unsigned nr_vecs, __u64 offset, int flags)
+{
+ io_uring_prep_readv(sqe, fd, iovecs, nr_vecs, offset);
+ sqe->rw_flags = flags;
+}
+
static inline void io_uring_prep_read_fixed(struct io_uring_sqe *sqe, int fd,
void *buf, unsigned nbytes,
__u64 offset, int buf_index)
@@ -327,6 +335,14 @@ static inline void io_uring_prep_writev(struct io_uring_sqe *sqe, int fd,
io_uring_prep_rw(IORING_OP_WRITEV, sqe, fd, iovecs, nr_vecs, offset);
}
+static inline void io_uring_prep_writev2(struct io_uring_sqe *sqe, int fd,
+ const struct iovec *iovecs,
+ unsigned nr_vecs, __u64 offset, int flags)
+{
+ io_uring_prep_writev(sqe, fd, iovecs, nr_vecs, offset);
+ sqe->rw_flags = flags;
+}
+
static inline void io_uring_prep_write_fixed(struct io_uring_sqe *sqe, int fd,
const void *buf, unsigned nbytes,
__u64 offset, int buf_index)