]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitbde7b41a006f19953e203e56fc8de00dc4706f08
treebcd47b08e456254dc914d38d8a03441114b03cf7
parent52c23476f72b1cad4f5cb38ebb374961da83eee5
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