summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-12-23 08:45:41 -0700
committerJens Axboe <axboe@kernel.dk>2019-12-23 08:45:41 -0700
commit0bed44fdc836c30c8720becda42a813999f3efe6 (patch)
tree9a0c7ee7483a671f9665913589673ffa0e32925a
parentd6440b00d15a42864425023cd4e90e5144ee0e21 (diff)
downloadliburing-0bed44fdc836c30c8720becda42a813999f3efe6.tar.gz
liburing-0bed44fdc836c30c8720becda42a813999f3efe6.tar.bz2
Add non-vectored read/write
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/include/liburing.h12
-rw-r--r--src/include/liburing/io_uring.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 78e8364..b2a75e6 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -317,6 +317,18 @@ static inline void io_uring_prep_close(struct io_uring_sqe *sqe, int fd)
io_uring_prep_rw(IORING_OP_CLOSE, sqe, fd, NULL, 0, 0);
}
+static inline void io_uring_prep_read(struct io_uring_sqe *sqe, int fd,
+ void *buf, unsigned nbytes, off_t offset)
+{
+ io_uring_prep_rw(IORING_OP_READ, sqe, fd, buf, nbytes, offset);
+}
+
+static inline void io_uring_prep_write(struct io_uring_sqe *sqe, int fd,
+ void *buf, unsigned nbytes, off_t offset)
+{
+ io_uring_prep_rw(IORING_OP_WRITE, sqe, fd, buf, nbytes, offset);
+}
+
struct statx;
static inline void io_uring_prep_statx(struct io_uring_sqe *sqe, int dfd,
const char *path, int flags, unsigned mask,
diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
index 762a63a..03d2dde 100644
--- a/src/include/liburing/io_uring.h
+++ b/src/include/liburing/io_uring.h
@@ -84,6 +84,8 @@ enum {
IORING_OP_CLOSE,
IORING_OP_FILES_UPDATE,
IORING_OP_STATX,
+ IORING_OP_READ,
+ IORING_OP_WRITE,
/* this goes last, obviously */
IORING_OP_LAST,