]> www.infradead.org Git - users/hch/block.git/commitdiff
ceph: use bvec_set_page to initialize a bvec
authorChristoph Hellwig <hch@lst.de>
Wed, 25 Jan 2023 16:26:49 +0000 (17:26 +0100)
committerChristoph Hellwig <hch@lst.de>
Wed, 25 Jan 2023 17:28:49 +0000 (18:28 +0100)
Use the bvec_set_page helper to initialize a bvec.

Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/ceph/file.c

index 764598e1efd91fd302890220061967135a929801..6419dce7c579878fbb6cfb8cbc33711cc3ac067e 100644 (file)
@@ -103,11 +103,11 @@ 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,
-                       };
+                       struct bio_vec bv;
+
+                       bvec_set_page(&bv, pages[idx], 
+                                     min_t(int, bytes, PAGE_SIZE - start),
+                                     start);
 
                        bvecs[bvec_idx] = bv;
                        bytes -= bv.bv_len;