block: implement bio helper to add iter bvec pages to bio
authorJens Axboe <axboe@kernel.dk>
Fri, 30 Nov 2018 15:47:03 +0000 (08:47 -0700)
committerJens Axboe <axboe@kernel.dk>
Sun, 6 Jan 2019 20:52:49 +0000 (13:52 -0700)
commit817c739877e4af79ffe4d28135dc0581026a42d6
tree66ebb6c261e008b6e95485cce9e9ec005d8a0237
parent388726377e26e9936192af0ce714f66edcc32e48
block: implement bio helper to add iter bvec pages to bio

For an ITER_BVEC, we can just iterate the iov and add the pages
to the bio directly. This requires that the caller doesn't releases
the pages on IO completion, we add a BIO_HOLD_PAGES flag for that.

The current two callers of bio_iov_iter_get_pages() are updated to
check if they need to release pages on completion. This makes them
work with bvecs that contain kernel mapped pages already.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c
fs/block_dev.c
fs/iomap.c
include/linux/blk_types.h