block: add a bio_add_max_vecs helper
authorChristoph Hellwig <hch@lst.de>
Wed, 7 May 2025 12:04:27 +0000 (14:04 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 7 May 2025 13:31:07 +0000 (07:31 -0600)
commit75f88659e47dc570bdebddf77d7a3cd5f0845612
tree9e0f8d29a9eb10b03d183e80affc9a257f77cf59
parent10b1e59cdadabff16fc78eb2ca4c341b1502293c
block: add a bio_add_max_vecs helper

Add a helper to check how many bio_vecs are needed to add a kernel
virtual address range to a bio, accounting for the always contiguous
direct mapping and vmalloc mappings that usually need a bio_vec
per page sized chunk.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20250507120451.4000627-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/bio.h