io_uring: deduplicate cancellation code
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 15 Aug 2021 09:40:22 +0000 (10:40 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 23 Aug 2021 19:10:37 +0000 (13:10 -0600)
commit8cb01fac982a3f8622a46821af1eb68136f936ca
tree6dc7e27a45d7ae9e24265fab22fe65ebd0c813b7
parenta8576af9d1b03a1b8aba7228e938ab0817fdbda6
io_uring: deduplicate cancellation code

IORING_OP_ASYNC_CANCEL and IORING_OP_LINK_TIMEOUT have enough of
overlap, so extract a helper for request cancellation and use in both.
Also, removes some amount of ugliness because of success_ret.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/900122b588e65b637e71bfec80a260726c6a54d6.1628981736.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c