diff mbox series

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

Message ID 20230130092157.1759539-13-hch@lst.de
State Superseded
Headers show
Series None | expand

Commit Message

Christoph Hellwig Jan. 30, 2023, 9:21 a.m. UTC
Use the bvec_set_page helper to initialize a bvec.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/ceph/file.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 764598e1efd91f..6419dce7c57987 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -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;