summaryrefslogtreecommitdiff
path: root/block/bio-integrity.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-02-03 16:06:12 +0100
committerJens Axboe <axboe@kernel.dk>2023-02-03 08:20:54 -0700
commitd58cdfae6a22e5079656c487aad669597a0635c8 (patch)
treeb2cfec440f8e45d1b2e75feecf6737b0681870db /block/bio-integrity.c
parent3f13ab7c80fdb0ada86a8e3e818960bc1ccbaa59 (diff)
downloadlwn-d58cdfae6a22e5079656c487aad669597a0635c8.tar.gz
lwn-d58cdfae6a22e5079656c487aad669597a0635c8.zip
block: factor out a bvec_set_page helper
Add a helper to initialize a bvec based of a page pointer. This will help removing various open code bvec initializations. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/20230203150634.3199647-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bio-integrity.c')
-rw-r--r--block/bio-integrity.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index 3f5685c00e36..a3776064c52a 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -124,23 +124,18 @@ int bio_integrity_add_page(struct bio *bio, struct page *page,
unsigned int len, unsigned int offset)
{
struct bio_integrity_payload *bip = bio_integrity(bio);
- struct bio_vec *iv;
if (bip->bip_vcnt >= bip->bip_max_vcnt) {
printk(KERN_ERR "%s: bip_vec full\n", __func__);
return 0;
}
- iv = bip->bip_vec + bip->bip_vcnt;
-
if (bip->bip_vcnt &&
bvec_gap_to_prev(&bdev_get_queue(bio->bi_bdev)->limits,
&bip->bip_vec[bip->bip_vcnt - 1], offset))
return 0;
- iv->bv_page = page;
- iv->bv_len = len;
- iv->bv_offset = offset;
+ bvec_set_page(&bip->bip_vec[bip->bip_vcnt], page, len, offset);
bip->bip_vcnt++;
return len;