
static int io_async_cancel_prep(struct io_kiocb *req,
				const struct io_uring_sqe *sqe)
{
	if (unlikely(req->flags & REQ_F_BUFFER_SELECT))
		return -EINVAL;
	if (sqe->off || sqe->len || sqe->splice_fd_in)
		return -EINVAL;

	req->cancel.addr = READ_ONCE(sqe->addr);
	req->cancel.flags = READ_ONCE(sqe->cancel_flags);
	if (req->cancel.flags & ~CANCEL_FLAGS)
		return -EINVAL;
	if (req->cancel.flags & IORING_ASYNC_CANCEL_FD) {
		if (req->cancel.flags & IORING_ASYNC_CANCEL_ANY)
			return -EINVAL;
		req->cancel.fd = READ_ONCE(sqe->fd);
	}

	return 0;

static int io_async_cancel_prep(struct io_kiocb *req,
				const struct io_uring_sqe *sqe)
{
	if (unlikely(req->flags & REQ_F_BUFFER_SELECT))
		return -EINVAL;
	if (sqe->off || sqe->len || sqe->splice_fd_in)
		return -EINVAL;

	req->cancel.addr = READ_ONCE(sqe->addr);
	req->cancel.flags = READ_ONCE(sqe->cancel_flags);
	if (req->cancel.flags & ~CANCEL_FLAGS)
		return -EINVAL;
	if (req->cancel.flags & IORING_ASYNC_CANCEL_FD) {
		if (req->cancel.flags & IORING_ASYNC_CANCEL_ANY)
			return -EINVAL;
		req->cancel.fd = READ_ONCE(sqe->fd);
	}

	return 0;