• Pavel Begunkov's avatar
    io_uring: move req preps out of io_issue_sqe() · c1379e24
    Pavel Begunkov authored
    All request preparations are done only during submission, reflect it in
    the code by moving io_req_prep() much earlier into io_queue_sqe().
    
    That's much cleaner, because it doen't expose bits to async code which
    it won't ever use. Also it makes the interface harder to misuse, and
    there are potential places for bugs.
    
    For instance, __io_queue() doesn't clear @sqe before proceeding to a
    next linked request, that could have been disastrous, but hopefully
    there are linked requests IFF sqe==NULL, so not actually a bug.
    Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    c1379e24
io_uring.c 231 KB