• Pavel Begunkov's avatar
    io_uring: deduplicate freeing linked timeouts · 7c86ffee
    Pavel Begunkov authored
    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: default avatarPavel Begunkov <asml.silence@gmail.com>
    [axboe: fold in locking fix for io_fail_links()]
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    7c86ffee
io_uring.c 202 KB