block: optimise submit_bio_checks for normal rw
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 13 Dec 2022 14:45:23 +0000 (07:45 -0700)
committerJens Axboe <axboe@kernel.dk>
Sun, 18 Dec 2022 18:20:01 +0000 (11:20 -0700)
commitdd002cc8aef74b6a0fa1e4c579eb84047ef2aa8a
tree8481111c493b086fc55bb6d4510db02b79bce5e8
parent5ee31aca6d4f59b7506d994723b072e5fffcdcd9
block: optimise submit_bio_checks for normal rw

Optimise the switch in submit_bio_checks() for reads, writes and
flushes. REQ_OP_READ/WRITE/FLUSH take numbers from 0 to 2, so the added
checks are compiled into a single condition:

if (op <= REQ_OP_FLUSH) {} else { switch() ... };

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/c53849108e8c2b831e78cd58b44244b27df43ab6.1634676157.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c