From: Christoph Hellwig Date: Fri, 3 Feb 2023 15:06:13 +0000 (+0100) Subject: block: add a bvec_set_folio helper X-Git-Tag: v6.6.17~5370^2~79 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=26db5ee158510108c819aa7be6eb8c75accf85d7;p=platform%2Fkernel%2Flinux-rpi.git block: add a bvec_set_folio helper A smaller wrapper around bvec_set_page that takes a folio instead. There are only two potential users for this in the tree, but the number will grow in the future. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20230203150634.3199647-3-hch@lst.de Signed-off-by: Jens Axboe --- diff --git a/include/linux/bvec.h b/include/linux/bvec.h index a7b7c01..b9e64b9 100644 --- a/include/linux/bvec.h +++ b/include/linux/bvec.h @@ -49,6 +49,19 @@ static inline void bvec_set_page(struct bio_vec *bv, struct page *page, bv->bv_offset = offset; } +/** + * bvec_set_folio - initialize a bvec based off a struct folio + * @bv: bvec to initialize + * @folio: folio the bvec should point to + * @len: length of the bvec + * @offset: offset into the folio + */ +static inline void bvec_set_folio(struct bio_vec *bv, struct folio *folio, + unsigned int len, unsigned int offset) +{ + bvec_set_page(bv, &folio->page, len, offset); +} + struct bvec_iter { sector_t bi_sector; /* device address in 512 byte sectors */