summaryrefslogtreecommitdiff
path: root/block/bio.c
diff options
context:
space:
mode:
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>2023-05-31 04:50:41 -0700
committerJens Axboe <axboe@kernel.dk>2023-06-01 09:13:31 -0600
commit7a150f1ed19b709837e98571f49ab1ff2625ca89 (patch)
tree4892853eb8700325115e159472ec3d49bb4c3735 /block/bio.c
parent83f2caaaf9cb25fe74775a59bf2662f184bfaa08 (diff)
block: add bio_add_folio_nofail
Just like for bio_add_pages() add a no-fail variant for bio_add_folio(). Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/924dff4077812804398ef84128fb920507fa4be1.1685532726.git.johannes.thumshirn@wdc.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bio.c')
-rw-r--r--block/bio.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/block/bio.c b/block/bio.c
index 798cc4cf3bd2..8672179213b9 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1138,6 +1138,14 @@ int bio_add_page(struct bio *bio, struct page *page,
}
EXPORT_SYMBOL(bio_add_page);
+void bio_add_folio_nofail(struct bio *bio, struct folio *folio, size_t len,
+ size_t off)
+{
+ WARN_ON_ONCE(len > UINT_MAX);
+ WARN_ON_ONCE(off > UINT_MAX);
+ __bio_add_page(bio, &folio->page, len, off);
+}
+
/**
* bio_add_folio - Attempt to add part of a folio to a bio.
* @bio: BIO to add to.