[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230130092157.1759539-3-hch@lst.de>
Date: Mon, 30 Jan 2023 10:21:36 +0100
From: Christoph Hellwig <hch@....de>
To: Jens Axboe <axboe@...nel.dk>
Cc: Ilya Dryomov <idryomov@...il.com>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Minchan Kim <minchan@...nel.org>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Keith Busch <kbusch@...nel.org>,
Sagi Grimberg <sagi@...mberg.me>,
Chaitanya Kulkarni <kch@...dia.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
David Howells <dhowells@...hat.com>,
Marc Dionne <marc.dionne@...istor.com>,
Xiubo Li <xiubli@...hat.com>, Steve French <sfrench@...ba.org>,
Trond Myklebust <trond.myklebust@...merspace.com>,
Anna Schumaker <anna@...nel.org>,
Mike Marshall <hubcap@...ibond.com>,
Andrew Morton <akpm@...ux-foundation.org>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Chuck Lever <chuck.lever@...cle.com>,
linux-block@...r.kernel.org, ceph-devel@...r.kernel.org,
virtualization@...ts.linux-foundation.org,
linux-nvme@...ts.infradead.org, linux-scsi@...r.kernel.org,
target-devel@...r.kernel.org, kvm@...r.kernel.org,
netdev@...r.kernel.org, linux-afs@...ts.infradead.org,
linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
linux-fsdevel@...r.kernel.org, linux-nfs@...r.kernel.org,
devel@...ts.orangefs.org, io-uring@...r.kernel.org,
linux-mm@...ck.org
Subject: [PATCH 02/23] 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 <hch@....de>
---
include/linux/bvec.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/include/linux/bvec.h b/include/linux/bvec.h
index 9e3dac51eb26b6..f094512ce3bda9 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
+ * @page: 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
Powered by blists - more mailing lists