block: optimise req_bio_endio()
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 19 Oct 2021 21:24:12 +0000 (22:24 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 20 Oct 2021 14:08:05 +0000 (08:08 -0600)
commit478eb72b815f33734723867ff236d96afa418d69
treedc81054f6f79d225ae7afcbab10996ca42b3cc09
parent859897c3fb9ad12fef429b026154e11350d0ceac
block: optimise req_bio_endio()

First, get rid of an extra branch and chain error checks. Also reshuffle
it with bio_advance(), so it goes closer to the final check, with that
the compiler loads rq->rq_flags only once, and also doesn't reload
bio->bi_iter.bi_size if bio_advance() didn't actually advanced the iter.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c