io_uring: move req preps out of io_issue_sqe()
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 30 Sep 2020 19:57:56 +0000 (22:57 +0300)
committerJens Axboe <axboe@kernel.dk>
Thu, 1 Oct 2020 02:38:46 +0000 (20:38 -0600)
commitc1379e247a724b2d4c646f1947d4f78c782c0650
treebcd47b08e456254dc914d38d8a03441114b03cf7
parentbfe76559833d5d76fc4eebdad7658d22522f8a22
io_uring: move req preps out of io_issue_sqe()

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: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c