From: Christoph Hellwig <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Ilya Dryomov <[email protected]>,
"Michael S. Tsirkin" <[email protected]>,
Jason Wang <[email protected]>,
Minchan Kim <[email protected]>,
Sergey Senozhatsky <[email protected]>,
Keith Busch <[email protected]>, Sagi Grimberg <[email protected]>,
Chaitanya Kulkarni <[email protected]>,
"Martin K. Petersen" <[email protected]>,
David Howells <[email protected]>,
Marc Dionne <[email protected]>,
Xiubo Li <[email protected]>, Steve French <[email protected]>,
Trond Myklebust <[email protected]>,
Anna Schumaker <[email protected]>,
Mike Marshall <[email protected]>,
Andrew Morton <[email protected]>,
"David S. Miller" <[email protected]>,
Eric Dumazet <[email protected]>,
Jakub Kicinski <[email protected]>, Paolo Abeni <[email protected]>,
Chuck Lever <[email protected]>,
[email protected], [email protected],
[email protected],
[email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected],
[email protected], [email protected],
[email protected]
Subject: [PATCH 05/23] target: use bvec_set_page to initialize bvecs
Date: Fri, 3 Feb 2023 16:06:16 +0100 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Use the bvec_set_page helper to initialize bvecs.
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
---
drivers/target/target_core_file.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index fd584111da45c0..ce0e000b74fc39 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -281,10 +281,8 @@ fd_execute_rw_aio(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
for_each_sg(sgl, sg, sgl_nents, i) {
- aio_cmd->bvecs[i].bv_page = sg_page(sg);
- aio_cmd->bvecs[i].bv_len = sg->length;
- aio_cmd->bvecs[i].bv_offset = sg->offset;
-
+ bvec_set_page(&aio_cmd->bvecs[i], sg_page(sg), sg->length,
+ sg->offset);
len += sg->length;
}
@@ -329,10 +327,7 @@ static int fd_do_rw(struct se_cmd *cmd, struct file *fd,
}
for_each_sg(sgl, sg, sgl_nents, i) {
- bvec[i].bv_page = sg_page(sg);
- bvec[i].bv_len = sg->length;
- bvec[i].bv_offset = sg->offset;
-
+ bvec_set_page(&bvec[i], sg_page(sg), sg->length, sg->offset);
len += sg->length;
}
@@ -465,10 +460,9 @@ fd_execute_write_same(struct se_cmd *cmd)
return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
for (i = 0; i < nolb; i++) {
- bvec[i].bv_page = sg_page(&cmd->t_data_sg[0]);
- bvec[i].bv_len = cmd->t_data_sg[0].length;
- bvec[i].bv_offset = cmd->t_data_sg[0].offset;
-
+ bvec_set_page(&bvec[i], sg_page(&cmd->t_data_sg[0]),
+ cmd->t_data_sg[0].length,
+ cmd->t_data_sg[0].offset);
len += se_dev->dev_attrib.block_size;
}
--
2.39.0
next prev parent reply other threads:[~2023-02-03 15:07 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-03 15:06 add bvec initialization helpers v2 Christoph Hellwig
2023-02-03 15:06 ` [PATCH 01/23] block: factor out a bvec_set_page helper Christoph Hellwig
2023-02-03 15:06 ` [PATCH 02/23] block: add a bvec_set_folio helper Christoph Hellwig
2023-02-03 15:06 ` [PATCH 03/23] block: add a bvec_set_virt helper Christoph Hellwig
2023-02-03 15:06 ` [PATCH 04/23] sd: factor out a sd_set_special_bvec helper Christoph Hellwig
2023-02-03 15:06 ` Christoph Hellwig [this message]
2023-02-03 15:06 ` [PATCH 06/23] nvmet: use bvec_set_page to initialize bvecs Christoph Hellwig
2023-02-03 15:06 ` [PATCH 07/23] nvme: use bvec_set_virt to initialize special_vec Christoph Hellwig
2023-02-03 15:06 ` [PATCH 08/23] rbd: use bvec_set_page to initialize the copy up bvec Christoph Hellwig
2023-02-03 15:06 ` [PATCH 09/23] virtio_blk: use bvec_set_virt to initialize special_vec Christoph Hellwig
2023-02-03 15:06 ` [PATCH 10/23] zram: use bvec_set_page to initialize bvecs Christoph Hellwig
2023-02-03 15:06 ` [PATCH 11/23] afs: use bvec_set_folio to initialize a bvec Christoph Hellwig
2023-02-03 15:06 ` [PATCH 12/23] ceph: use bvec_set_page " Christoph Hellwig
2023-02-03 17:14 ` Ilya Dryomov
2023-02-03 15:06 ` [PATCH 13/23] cifs: use bvec_set_page to initialize bvecs Christoph Hellwig
2023-02-03 15:06 ` [PATCH 14/23] coredump: use bvec_set_page to initialize a bvec Christoph Hellwig
2023-02-03 15:06 ` [PATCH 15/23] nfs: use bvec_set_page to initialize bvecs Christoph Hellwig
2023-02-03 15:06 ` [PATCH 16/23] orangefs: use bvec_set_{page,folio} " Christoph Hellwig
2023-02-03 15:06 ` [PATCH 17/23] splice: use bvec_set_page to initialize a bvec Christoph Hellwig
2023-02-03 15:06 ` [PATCH 18/23] io_uring: " Christoph Hellwig
2023-02-03 15:06 ` [PATCH 19/23] swap: use bvec_set_page to initialize bvecs Christoph Hellwig
2023-02-03 15:06 ` [PATCH 20/23] rxrpc: use bvec_set_page to initialize a bvec Christoph Hellwig
2023-02-03 15:06 ` [PATCH 21/23] sunrpc: use bvec_set_page to initialize bvecs Christoph Hellwig
2023-02-03 15:06 ` [PATCH 22/23] vringh: use bvec_set_page to initialize a bvec Christoph Hellwig
2023-02-03 15:06 ` [PATCH 23/23] libceph: use bvec_set_page to initialize bvecs Christoph Hellwig
2023-02-03 17:18 ` add bvec initialization helpers v2 Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2023-01-30 9:21 add bvec initialization helpers Christoph Hellwig
2023-01-30 9:21 ` [PATCH 05/23] target: use bvec_set_page to initialize bvecs Christoph Hellwig
2023-01-31 6:56 ` Chaitanya Kulkarni
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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