io_uring: shove more drain bits out of hot path
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 15 Jun 2021 15:47:57 +0000 (16:47 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 15 Jun 2021 21:44:34 +0000 (15:44 -0600)
commit3c19966d3710dbe5a44658c532052f11d797aecb
tree8c89977de6f8f1ec044ab5ba763b294b7813def7
parent10c669040e9b3538e1732c8d40729636b17ce9dd
io_uring: shove more drain bits out of hot path

Place all drain_next logic into io_drain_req(), so it's never executed
if there was no drained requests before. The only thing we need is to
set ->drain_active if we see a request with IOSQE_IO_DRAIN, do that in
io_init_req() where flags are definitely in registers.

Also, all drain-related code is encapsulated in io_drain_req(), makes it
cleaner.

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