block: only allow contiguous page structs in a bio_vec
authorChristoph Hellwig <hch@lst.de>
Thu, 11 Apr 2019 06:23:31 +0000 (08:23 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 12 Apr 2019 15:06:42 +0000 (09:06 -0600)
commit52d52d1c98a90cfe860b83498e4b6074aad95c15
tree98776fc54f50c9a9168162e030ee9db6b89c2d46
parent7321ecbfc7cf85211460a1dc6bb0ccfc3dcf9df0
block: only allow contiguous page structs in a bio_vec

We currently have to call nth_page when iterating over pages inside a
bio_vec.  Jens complained a while ago that this is fairly expensive.
To mitigate this we can check that that the actual page structures
are contiguous when adding them to the bio, and just do check pointer
arithmetics later on.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c
include/linux/bvec.h