• Pavel Begunkov's avatar
    io_uring: lazy get task · 4dd2824d
    Pavel Begunkov authored
    There will be multiple places where req->task is used, so refcount-pin
    it lazily with introduced *io_{get,put}_req_task(). We need to always
    have valid ->task for cancellation reasons, but don't care about pinning
    it in some cases. That's why it sets req->task in io_req_init() and
    implements get/put laziness with a flag.
    
    This also removes using @current from polling io_arm_poll_handler(),
    etc., but doesn't change observable behaviour.
    Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    4dd2824d
io_uring.c 193 KB