Commit 26db5ee1 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20230203150634.3199647-3-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent d58cdfae
...@@ -49,6 +49,19 @@ static inline void bvec_set_page(struct bio_vec *bv, struct page *page, ...@@ -49,6 +49,19 @@ static inline void bvec_set_page(struct bio_vec *bv, struct page *page,
bv->bv_offset = offset; 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 { struct bvec_iter {
sector_t bi_sector; /* device address in 512 byte sector_t bi_sector; /* device address in 512 byte
sectors */ sectors */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment