io_uring: always batch cancel in *cancel_files()
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 9 Feb 2021 04:47:39 +0000 (04:47 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Feb 2021 12:54:56 +0000 (13:54 +0100)
commitdbdcde4422dfb1a3da6d41abffc546c74190c25a
tree3b49546e89ebaa09ba9c8231c68914e693b190e0
parentf8fbdbb6079314f5f4076303cb0552f815a47aa0
io_uring: always batch cancel in *cancel_files()

[ Upstream commit f6edbabb8359798c541b0776616c5eab3a840d3d ]

Instead of iterating over each request and cancelling it individually in
io_uring_cancel_files(), try to cancel all matching requests and use
->inflight_list only to check if there anything left.

In many cases it should be faster, and we can reuse a lot of code from
task cancellation.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/io-wq.c
fs/io-wq.h
fs/io_uring.c