block: optimise submit_bio_checks for normal rw
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 27 Mar 2022 21:15:18 +0000 (15:15 -0600)
committerJens Axboe <axboe@kernel.dk>
Sun, 27 Mar 2022 21:15:18 +0000 (15:15 -0600)
commit3194b2264155a7bf34dad5386a14bcbdab72d7cd
tree567f265f9dfbb71dafa98985603fbb3d873051a4
parente95cc7ac24cddafc9ee45beb56928faa2936ce08
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