]> git.baikalelectronics.ru Git - kernel.git/commit
blk-merge: compute bio->bi_seg_front_size efficiently
authorMing Lei <ming.lei@redhat.com>
Mon, 18 Dec 2017 12:22:14 +0000 (20:22 +0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 6 Jan 2018 16:18:00 +0000 (09:18 -0700)
commitbefb554dba048654359a550fec0237b719277c8d
treecc869dfac6aaf6205896fd1e2adf9631f4d75b70
parent6c9fdaaff0d2edce0bf2285c470351fbf0237b82
blk-merge: compute bio->bi_seg_front_size efficiently

It is enough to check and compute bio->bi_seg_front_size just
after the 1st segment is found, but current code checks that
for each bvec, which is inefficient.

This patch follows the way in  __blk_recalc_rq_segments()
for computing bio->bi_seg_front_size, and it is more efficient
and code becomes more readable too.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-merge.c