diff options
| author | Christoph Hellwig <hch@lst.de> | 2025-05-07 14:04:25 +0200 |
|---|---|---|
| committer | Sasha Levin <sashal@kernel.org> | 2026-03-04 07:19:26 -0500 |
| commit | cef2315cb84ebcb9b9fb2873e72c7a784a497079 (patch) | |
| tree | 60a064a86c5f8f8298ebce410ca7135274f3366b /include/linux | |
| parent | 4d339b219004869e96c4ce56b8891f83a38da4c0 (diff) | |
block: add a bio_add_virt_nofail helper
[ Upstream commit 850e210d5ad21b94b55b97d4d82b4cdeb0bb05df ]
Add a helper to add a directly mapped kernel virtual address to a
bio so that callers don't have to convert to pages or folios.
For now only the _nofail variant is provided as that is what all the
obvious callers want.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20250507120451.4000627-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Stable-dep-of: 4ac9690d4b94 ("rnbd-srv: Fix server side setting of bi_size for special IOs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bio.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index 1289b8e48780..80ca2fb87950 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -425,6 +425,8 @@ void __bio_add_page(struct bio *bio, struct page *page, unsigned int len, unsigned int off); void bio_add_folio_nofail(struct bio *bio, struct folio *folio, size_t len, size_t off); +void bio_add_virt_nofail(struct bio *bio, void *vaddr, unsigned len); + int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter); void bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter); void __bio_release_pages(struct bio *bio, bool mark_dirty); |
