man/io_uring_prep_cancel.3: document new 5.19 cancelation flags
@@ -13,17 +13,22 @@ io_uring_prep_cancel - prepare a cancelation request
.BI "void io_uring_prep_cancel(struct io_uring_sqe *" sqe ","
.BI " __u64 " user_data ","
.BI " int " flags ");"
+.BI "
+.BI "void io_uring_prep_cancel_fd(struct io_uring_sqe *" sqe ","
+.BI " int " fd ","
+.BI " int " flags ");"
.PP
.SH DESCRIPTION
.PP
-The io_uring_prep_cancel() function prepares a cancelation request. The
-submission queue entry
+The
+.BR io_uring_prep_cancel()
+function prepares a cancelation request. The submission queue entry
.I sqe
is prepared to cancel an existing request identified by
.I user_data.
-The
+For the
.I flags
-argument is currently unused.
+argument, see below.
The cancelation request will attempt to find the previously issued request
identified by
@@ -33,14 +38,49 @@ their
.I user_data
field in the SQE.
+The
+.BR io_uring_prep_cancel_fd()
+function prepares a cancelation request. The submission queue entry
+.I sqe
+is prepared to cancel an existing request that used the file descriptor
+.I fd.
+For the
+.I flags
+argument, see below.
+
+The cancelation request will attempt to find the previously issued request
+that used
+.I fd
+as the file descriptor and cancel it.
+
+By default, the first request matching the criteria given will be canceled.
+This can be modified with any of the following flags passed in:
+.TP
+.B IORING_ASYNC_CANCEL_ALL
+Cancel all requests that match the given criteria, rather than just canceling
+the first one found. Available since 5.19.
+.TP
+.B IORING_ASYNC_CANCEL_FD
+Match based on the file descriptor used in the original request rather than
+the user_data. This is what
+.BR io_uring_prep_cancel_fd (3)
+sets up. Available since 5.19.
+.TP
+.B IORING_ASYNC_CANCEL_ANY
+Match any request in the ring, regardless of user_data or file descriptor.
+Can be used to cancel any pending request in the ring. Available since 5.19.
+.P
+
.SH RETURN VALUE
None
.SH ERRORS
These are the errors that are reported in the CQE
.I res
-field. On success,
+field. If no flags are used to cancel multiple requests,
.B 0
-is returned.
+is returned on success. If flags are used to match multiple requests, then
+a positive value is returned indicating how many requests were found and
+canceled.
.TP
.B -ENOENT
The request identified by
