]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - fs/io_uring.c
io_uring: deduplicate freeing linked timeouts
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 29 Jun 2020 10:12:59 +0000 (13:12 +0300)
committerJens Axboe <axboe@kernel.dk>
Tue, 30 Jun 2020 14:38:58 +0000 (08:38 -0600)
commit7c86ffeeed303187f266ed17bd87a9b375955709
treed589944e8631359a8a3199073121c60ace69199f
parentfb49278624f75e15d36c3c43d322ca8961fb40e9
io_uring: deduplicate freeing linked timeouts

Linked timeout cancellation code is repeated in in io_req_link_next()
and io_fail_links(), and they differ in details even though shouldn't.
Basing on the fact that there is maximum one armed linked timeout in
a link, and it immediately follows the head, extract a function that
will check for it and defuse.

Justification:
- DRY and cleaner
- better inlining for io_req_link_next() (just 1 call site now)
- isolates linked_timeouts from common path
- reduces time under spinlock for failed links
- actually less code

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
[axboe: fold in locking fix for io_fail_links()]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c