liburing.h: add io_uring_prep_cancel_fd()

This sets up the cancelation request to be fd based.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe
2022-04-15 19:43:47 -06:00
parent de9f836308
commit 825d505ac1
+7
View File
@@ -510,6 +510,13 @@ static inline void io_uring_prep_cancel(struct io_uring_sqe *sqe,
sqe->cancel_flags = (__u32) flags;
}
static inline void io_uring_prep_cancel_fd(struct io_uring_sqe *sqe, int fd,
unsigned int flags)
{
io_uring_prep_rw(IORING_OP_ASYNC_CANCEL, sqe, fd, NULL, 0, 0);
sqe->cancel_flags = (__u32) flags | IORING_ASYNC_CANCEL_FD;
}
static inline void io_uring_prep_link_timeout(struct io_uring_sqe *sqe,
struct __kernel_timespec *ts,
unsigned flags)