summaryrefslogtreecommitdiff
path: root/src/include/liburing.h
diff options
context:
space:
mode:
authorHao Xu <howeyxu@tencent.com>2022-05-14 22:35:31 +0800
committerJens Axboe <axboe@kernel.dk>2022-05-14 09:15:38 -0600
commit305eb96b9dbb84a3dd3151d0debde753a354d81e (patch)
tree284038cc0814d5f23e027971b0cee4c5bea71212 /src/include/liburing.h
parente7c7089e352f5a6ead9c409a7d8a43ffe9cd59a5 (diff)
downloadliburing-305eb96b9dbb84a3dd3151d0debde753a354d81e.tar.gz
liburing-305eb96b9dbb84a3dd3151d0debde753a354d81e.tar.bz2
liburing.h: add api to support multishot accept direct
This is to support the multishot accept directly to the fixed table, the file_Index should be set to IORING_FILE_INDEX_ALLOC in this case. Signed-off-by: Hao Xu <howeyxu@tencent.com> Link: https://lore.kernel.org/r/20220514143534.59162-4-haoxu.linux@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'src/include/liburing.h')
-rw-r--r--src/include/liburing.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h
index cf50383..9065555 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -512,6 +512,17 @@ static inline void io_uring_prep_multishot_accept(struct io_uring_sqe *sqe,
sqe->ioprio |= IORING_ACCEPT_MULTISHOT;
}
+/* multishot accept directly into the fixed file table */
+static inline void io_uring_prep_multishot_accept_direct(struct io_uring_sqe *sqe,
+ int fd,
+ struct sockaddr *addr,
+ socklen_t *addrlen,
+ int flags)
+{
+ io_uring_prep_multishot_accept(sqe, fd, addr, addrlen, flags);
+ __io_uring_set_target_fixed_file(sqe, IORING_FILE_INDEX_ALLOC - 1);
+}
+
static inline void io_uring_prep_cancel(struct io_uring_sqe *sqe,
__u64 user_data, int flags)
{