]> git.baikalelectronics.ru Git - kernel.git/commit
block: use bio_for_each_bvec() to compute multi-page bvec count
authorMing Lei <ming.lei@redhat.com>
Fri, 15 Feb 2019 11:13:12 +0000 (19:13 +0800)
committerJens Axboe <axboe@kernel.dk>
Fri, 15 Feb 2019 15:40:11 +0000 (08:40 -0700)
commitdabaa841f49c85632c6fdfa84739f75925e46d5d
tree922b2370aa43de5b73e1b4f57c4267fd48b84de9
parent8a81b30389838cd8198516d47dc5e29495a13ebf
block: use bio_for_each_bvec() to compute multi-page bvec count

First it is more efficient to use bio_for_each_bvec() in both
blk_bio_segment_split() and __blk_recalc_rq_segments() to compute how
many multi-page bvecs there are in the bio.

Secondly once bio_for_each_bvec() is used, the bvec may need to be
splitted because its length can be very longer than max segment size,
so we have to split the big bvec into several segments.

Thirdly when splitting multi-page bvec into segments, the max segment
limit may be reached, so the bio split need to be considered under
this situation too.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-merge.c