[PATCH 40/60] blk-merge: compute bio->bi_seg_front_size efficiently

2016-10-29 Thread Ming Lei
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

[PATCH 40/60] blk-merge: compute bio->bi_seg_front_size efficiently

2016-10-29 Thread Ming Lei
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