Thread (26 messages) 26 messages, 3 authors, 2023-02-03

Re: [PATCH 12/23] ceph: use bvec_set_page to initialize a bvec

From: Ilya Dryomov <idryomov@gmail.com>
Date: 2023-02-03 17:14:40
Also in: ceph-devel, io-uring, kvm, linux-block, linux-cifs, linux-fsdevel, linux-mm, linux-nfs, linux-nvme, linux-scsi, target-devel

On Fri, Feb 3, 2023 at 4:07 PM Christoph Hellwig [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Use the bvec_set_page helper to initialize a bvec.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/ceph/file.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 764598e1efd91f..90b2aa7963bf29 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -103,14 +103,10 @@ static ssize_t __iter_get_bvecs(struct iov_iter *iter, size_t maxsize,
                size += bytes;

                for ( ; bytes; idx++, bvec_idx++) {
-                       struct bio_vec bv = {
-                               .bv_page = pages[idx],
-                               .bv_len = min_t(int, bytes, PAGE_SIZE - start),
-                               .bv_offset = start,
-                       };
-
-                       bvecs[bvec_idx] = bv;
-                       bytes -= bv.bv_len;
+                       int len = min_t(int, bytes, PAGE_SIZE - start);
+
+                       bvec_set_page(&bvecs[bvec_idx], pages[idx], len, start);
+                       bytes -= len;
                        start = 0;
                }
        }
--
2.39.0
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>

Thanks,

                Ilya
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help