diff options
author | Jens Axboe <axboe@kernel.dk> | 2023-06-23 18:04:35 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-07-17 19:05:48 +0300 |
commit | a30badf66de8516b5a5bca7a5d339f377ff983ea (patch) | |
tree | e9fc1497aa6acd62059b0eaee3096ecb1fedd877 /io_uring/timeout.c | |
parent | 3a372b66923e4af966af2900da588e3b3de6fcd2 (diff) | |
download | linux-a30badf66de8516b5a5bca7a5d339f377ff983ea.tar.xz |
io_uring: use cancelation match helper for poll and timeout requests
Get rid of the request vs io_cancel_data checking and just use the
exported helper for this.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/timeout.c')
-rw-r--r-- | io_uring/timeout.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/io_uring/timeout.c b/io_uring/timeout.c index 4200099ad96e..6242130e73c6 100644 --- a/io_uring/timeout.c +++ b/io_uring/timeout.c @@ -268,16 +268,10 @@ static struct io_kiocb *io_timeout_extract(struct io_ring_ctx *ctx, list_for_each_entry(timeout, &ctx->timeout_list, list) { struct io_kiocb *tmp = cmd_to_io_kiocb(timeout); - if (!(cd->flags & IORING_ASYNC_CANCEL_ANY) && - cd->data != tmp->cqe.user_data) - continue; - if (cd->flags & (IORING_ASYNC_CANCEL_ALL|IORING_ASYNC_CANCEL_ANY)) { - if (cd->seq == tmp->work.cancel_seq) - continue; - tmp->work.cancel_seq = cd->seq; + if (io_cancel_req_match(tmp, cd)) { + req = tmp; + break; } - req = tmp; - break; } if (!req) return ERR_PTR(-ENOENT); |