diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2020-02-24 19:03:49 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-02-24 09:08:25 -0700 |
commit | 4f4eff4ca75f7ef843834ab8e66655438b1cf82f (patch) | |
tree | da307c06b8e6a160c6c2c0cb3f2c77292d80712c /src/include/liburing.h | |
parent | 1b5c910775a5967b63a7632add2f4d00d3722036 (diff) | |
download | liburing-4f4eff4ca75f7ef843834ab8e66655438b1cf82f.tar.gz liburing-4f4eff4ca75f7ef843834ab8e66655438b1cf82f.tar.bz2 |
splice: add splice(2) helpers
Add splice helpers and update io_uring.h
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'src/include/liburing.h')
-rw-r--r-- | src/include/liburing.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h index b8bcdf5..7edd4f1 100644 --- a/src/include/liburing.h +++ b/src/include/liburing.h @@ -191,6 +191,18 @@ static inline void io_uring_prep_rw(int op, struct io_uring_sqe *sqe, int fd, sqe->__pad2[0] = sqe->__pad2[1] = sqe->__pad2[2] = 0; } +static inline void io_uring_prep_splice(struct io_uring_sqe *sqe, + int fd_in, loff_t off_in, + int fd_out, loff_t off_out, + unsigned int nbytes, + unsigned int splice_flags) +{ + io_uring_prep_rw(IORING_OP_SPLICE, sqe, fd_out, (void *)off_in, + nbytes, off_out); + sqe->splice_fd_in = fd_in; + sqe->splice_flags = splice_flags; +} + static inline void io_uring_prep_readv(struct io_uring_sqe *sqe, int fd, const struct iovec *iovecs, unsigned nr_vecs, off_t offset) |