Thread (26 messages) 26 messages, 3 authors, 2023-02-03
STALE1238d LANDED: 2 (1M)

[PATCH 02/23] block: add a bvec_set_folio helper

From: Christoph Hellwig <hch@lst.de>
Date: 2023-02-03 15:07:33
Also in: ceph-devel, io-uring, kvm, linux-cifs, linux-fsdevel, linux-mm, linux-nfs, linux-nvme, linux-scsi, netdev, target-devel, virtualization
Subsystem: the rest · Maintainer: Linus Torvalds

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 <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Johannes Thumshirn <redacted>
---
 include/linux/bvec.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff --git a/include/linux/bvec.h b/include/linux/bvec.h
index 9e3dac51eb26b6..2bae1134499e7f 100644
--- a/include/linux/bvec.h
+++ b/include/linux/bvec.h
@@ -50,6 +50,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 */
-- 
2.39.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help