From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: kvm@vger.kernel.org, "Michael S. Tsirkin" <mst@redhat.com>,
linux-nvme@lists.infradead.org,
virtualization@lists.linux-foundation.org,
David Howells <dhowells@redhat.com>,
linux-mm@kvack.org, Eric Dumazet <edumazet@google.com>,
target-devel@vger.kernel.org,
Marc Dionne <marc.dionne@auristor.com>,
linux-afs@lists.infradead.org,
Mike Marshall <hubcap@omnibond.com>,
linux-cifs@vger.kernel.org, Sagi Grimberg <sagi@grimberg.me>,
linux-scsi@vger.kernel.org, Minchan Kim <minchan@kernel.org>,
io-uring@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
Ilya Dryomov <idryomov@gmail.com>,
Paolo Abeni <pabeni@redhat.com>,
devel@lists.orangefs.org, linux-block@vger.kernel.org,
Keith Busch <kbusch@kernel.org>,
ceph-devel@vger.kernel.org, Xiubo Li <xiubli@redhat.com>,
Trond Myklebust <trond.myklebust@hammerspace.com>,
linux-nfs@vger.kernel.org,
"Martin K. Petersen" <martin.petersen@oracle.com>,
netdev@vger.kernel.org, samba-technical@lists.samba.org,
Steve French <sfrench@samba.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Chuck Lever <chuck.lever@oracle.com>,
Anna Schumaker <anna@kernel.org>,
linux-fsdevel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 06/23] nvmet: use bvec_set_page to initialize bvecs
Date: Mon, 30 Jan 2023 10:21:40 +0100 [thread overview]
Message-ID: <20230130092157.1759539-7-hch@lst.de> (raw)
In-Reply-To: <20230130092157.1759539-1-hch@lst.de>
Use the bvec_set_page helper to initialize bvecs.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvme/target/io-cmd-file.c | 10 ++--------
drivers/nvme/target/tcp.c | 5 ++---
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c
index 871c4f32f443f5..2d068439b129c5 100644
--- a/drivers/nvme/target/io-cmd-file.c
+++ b/drivers/nvme/target/io-cmd-file.c
@@ -73,13 +73,6 @@ int nvmet_file_ns_enable(struct nvmet_ns *ns)
return ret;
}
-static void nvmet_file_init_bvec(struct bio_vec *bv, struct scatterlist *sg)
-{
- bv->bv_page = sg_page(sg);
- bv->bv_offset = sg->offset;
- bv->bv_len = sg->length;
-}
-
static ssize_t nvmet_file_submit_bvec(struct nvmet_req *req, loff_t pos,
unsigned long nr_segs, size_t count, int ki_flags)
{
@@ -146,7 +139,8 @@ static bool nvmet_file_execute_io(struct nvmet_req *req, int ki_flags)
memset(&req->f.iocb, 0, sizeof(struct kiocb));
for_each_sg(req->sg, sg, req->sg_cnt, i) {
- nvmet_file_init_bvec(&req->f.bvec[bv_cnt], sg);
+ bvec_set_page(&req->f.bvec[bv_cnt], sg_page(sg), sg->length,
+ sg->offset);
len += req->f.bvec[bv_cnt].bv_len;
total_len += req->f.bvec[bv_cnt].bv_len;
bv_cnt++;
diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
index cc05c094de221d..c5759eb503d004 100644
--- a/drivers/nvme/target/tcp.c
+++ b/drivers/nvme/target/tcp.c
@@ -321,9 +321,8 @@ static void nvmet_tcp_build_pdu_iovec(struct nvmet_tcp_cmd *cmd)
while (length) {
u32 iov_len = min_t(u32, length, sg->length - sg_offset);
- iov->bv_page = sg_page(sg);
- iov->bv_len = sg->length;
- iov->bv_offset = sg->offset + sg_offset;
+ bvec_set_page(iov, sg_page(sg), sg->length,
+ sg->offset + sg_offset);
length -= iov_len;
sg = sg_next(sg);
--
2.39.0
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next prev parent reply other threads:[~2023-01-30 9:23 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 9:21 add bvec initialization helpers Christoph Hellwig
2023-01-30 9:21 ` [PATCH 01/23] block: factor out a bvec_set_page helper Christoph Hellwig
2023-01-30 17:09 ` Bart Van Assche
2023-01-30 19:24 ` Bart Van Assche
2023-01-31 13:45 ` Christoph Hellwig
[not found] ` <20230130204758.38f4c6b9@kernel.org>
2023-01-31 5:00 ` Matthew Wilcox
2023-01-31 5:28 ` Matthew Wilcox
2023-01-30 9:21 ` [PATCH 02/23] block: add a bvec_set_folio helper Christoph Hellwig
2023-01-30 9:21 ` [PATCH 03/23] block: add a bvec_set_virt helper Christoph Hellwig
2023-01-30 9:21 ` [PATCH 04/23] sd: factor out a sd_set_special_bvec helper Christoph Hellwig
2023-01-30 9:21 ` [PATCH 05/23] target: use bvec_set_page to initialize bvecs Christoph Hellwig
2023-01-30 9:21 ` Christoph Hellwig [this message]
2023-01-30 9:21 ` [PATCH 07/23] nvme: use bvec_set_virt to initialize special_vec Christoph Hellwig
2023-01-30 9:21 ` [PATCH 08/23] rbd: use bvec_set_page to initialize the copy up bvec Christoph Hellwig
2023-01-30 9:21 ` [PATCH 09/23] virtio_blk: use bvec_set_virt to initialize special_vec Christoph Hellwig
2023-01-30 15:17 ` Michael S. Tsirkin
2023-01-31 3:22 ` Jason Wang
2023-01-30 9:21 ` [PATCH 10/23] zram: use bvec_set_page to initialize bvecs Christoph Hellwig
2023-01-30 9:21 ` [PATCH 11/23] afs: use bvec_set_folio to initialize a bvec Christoph Hellwig
2023-01-30 9:21 ` [PATCH 12/23] ceph: use bvec_set_page " Christoph Hellwig
2023-01-30 9:21 ` [PATCH 13/23] cifs: use bvec_set_page to initialize bvecs Christoph Hellwig
2023-01-30 9:21 ` [PATCH 14/23] coredump: use bvec_set_page to initialize a bvec Christoph Hellwig
2023-01-30 9:21 ` [PATCH 15/23] nfs: use bvec_set_page to initialize bvecs Christoph Hellwig
2023-01-30 9:21 ` [PATCH 16/23] orangefs: use bvec_set_{page, folio} " Christoph Hellwig
2023-01-30 9:21 ` [PATCH 17/23] splice: use bvec_set_page to initialize a bvec Christoph Hellwig
2023-01-30 9:21 ` [PATCH 18/23] io_uring: " Christoph Hellwig
2023-01-30 9:21 ` [PATCH 19/23] swap: use bvec_set_page to initialize bvecs Christoph Hellwig
2023-01-30 9:21 ` [PATCH 20/23] rxrpc: use bvec_set_page to initialize a bvec Christoph Hellwig
2023-01-30 9:21 ` [PATCH 21/23] sunrpc: use bvec_set_page to initialize bvecs Christoph Hellwig
2023-01-30 9:21 ` [PATCH 22/23] vring: use bvec_set_page to initialize a bvec Christoph Hellwig
2023-01-30 15:19 ` Michael S. Tsirkin
2023-01-31 2:31 ` Jason Wang
2023-01-30 9:21 ` [PATCH 23/23] net-ceph: use bvec_set_page to initialize bvecs Christoph Hellwig
2023-01-30 10:31 ` [PATCH 20/23] rxrpc: use bvec_set_page to initialize a bvec David Howells
2023-01-30 10:33 ` Christoph Hellwig
2023-01-30 11:24 ` David Howells
2023-01-30 12:18 ` Christoph Hellwig
2023-01-30 10:33 ` [PATCH 01/23] block: factor out a bvec_set_page helper David Howells
2023-01-30 10:36 ` Christoph Hellwig
2023-01-30 15:58 ` [PATCH 20/23] rxrpc: use bvec_set_page to initialize a bvec David Howells
2023-01-30 15:59 ` [PATCH 11/23] afs: use bvec_set_folio " David Howells
2023-02-03 15:06 add bvec initialization helpers v2 Christoph Hellwig
2023-02-03 15:06 ` [PATCH 06/23] nvmet: use bvec_set_page to initialize bvecs Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230130092157.1759539-7-hch@lst.de \
--to=hch@lst.de \
--cc=akpm@linux-foundation.org \
--cc=anna@kernel.org \
--cc=axboe@kernel.dk \
--cc=ceph-devel@vger.kernel.org \
--cc=chuck.lever@oracle.com \
--cc=davem@davemloft.net \
--cc=devel@lists.orangefs.org \
--cc=dhowells@redhat.com \
--cc=edumazet@google.com \
--cc=hubcap@omnibond.com \
--cc=idryomov@gmail.com \
--cc=io-uring@vger.kernel.org \
--cc=kbusch@kernel.org \
--cc=kuba@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=marc.dionne@auristor.com \
--cc=martin.petersen@oracle.com \
--cc=minchan@kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sagi@grimberg.me \
--cc=samba-technical@lists.samba.org \
--cc=senozhatsky@chromium.org \
--cc=sfrench@samba.org \
--cc=target-devel@vger.kernel.org \
--cc=trond.myklebust@hammerspace.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=xiubli@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).