]> 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)
commit742f3ca4cf76ea7ba62d5f2c2894d0ad46ec0a67
treebcd47b08e456254dc914d38d8a03441114b03cf7
parentabf7879ea70cb59c7ba5850939327df4f5abf087
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