io_uring: refactor io_alloc_req
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 9 Aug 2021 12:04:08 +0000 (13:04 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Aug 2021 15:05:45 +0000 (09:05 -0600)
commita71a40b5ec686ce903e745fbd840b9425e835329
treee0b2ca62c2b4abb09f2bc4985411c8e9e03346d5
parent288c2c67a0e1a4aac858329bf1a66c878bbe5e33
io_uring: refactor io_alloc_req

Replace the main if of io_flush_cached_reqs() with inverted condition +
goto, so all the cases are handled in the same way. And also extract
io_preinit_req() to make it cleaner and easier to refer to.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/1abcba1f7b55dc53bf1dbe95036e345ffb1d5b01.1628471125.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c