summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-10-29 08:46:31 -0600
committerJens Axboe <axboe@kernel.dk>2019-10-29 08:46:31 -0600
commitaa3c760ed21abb26777f5c438911de21b2d16ab5 (patch)
tree7b41b60802d4bd5a6c66692b56a4daa0ed6a20b2
parent6cfaab20bf2991df8223f1fd8161ecda26fc408d (diff)
downloadliburing-aa3c760ed21abb26777f5c438911de21b2d16ab5.tar.gz
liburing-aa3c760ed21abb26777f5c438911de21b2d16ab5.tar.bz2
Add IORING_OP_ASYNC_CANCEL and prep helper
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/include/liburing.h7
-rw-r--r--src/include/liburing/io_uring.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 4e89a8a..e8b6adb 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -278,6 +278,13 @@ static inline void io_uring_prep_accept(struct io_uring_sqe *sqe, int fd,
sqe->accept_flags = flags;
}
+static inline void io_uring_prep_cancel(struct io_uring_sqe *sqe, void *user_data,
+ int flags)
+{
+ io_uring_prep_rw(IORING_OP_ASYNC_CANCEL, sqe, 0, user_data, 0, 0);
+ sqe->cancel_flags = flags;
+}
+
static inline unsigned io_uring_sq_space_left(struct io_uring *ring)
{
return *ring->sq.kring_entries - (ring->sq.sqe_tail - ring->sq.sqe_head);
diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
index f82d90e..6877cf8 100644
--- a/src/include/liburing/io_uring.h
+++ b/src/include/liburing/io_uring.h
@@ -33,6 +33,7 @@ struct io_uring_sqe {
__u32 msg_flags;
__u32 timeout_flags;
__u32 accept_flags;
+ __u32 cancel_flags;
};
__u64 user_data; /* data to be passed back at completion time */
union {
@@ -70,6 +71,7 @@ struct io_uring_sqe {
#define IORING_OP_TIMEOUT 11
#define IORING_OP_TIMEOUT_REMOVE 12
#define IORING_OP_ACCEPT 13
+#define IORING_OP_ASYNC_CANCEL 14
/*
* sqe->fsync_flags