Commit 5c6542b6 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

ceph: use bvec_set_page to initialize a bvec

Use the bvec_set_page helper to initialize a bvec.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230203150634.3199647-13-hch@lst.deReviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent a8173be1
...@@ -103,14 +103,10 @@ static ssize_t __iter_get_bvecs(struct iov_iter *iter, size_t maxsize, ...@@ -103,14 +103,10 @@ static ssize_t __iter_get_bvecs(struct iov_iter *iter, size_t maxsize,
size += bytes; size += bytes;
for ( ; bytes; idx++, bvec_idx++) { for ( ; bytes; idx++, bvec_idx++) {
struct bio_vec bv = { int len = min_t(int, bytes, PAGE_SIZE - start);
.bv_page = pages[idx],
.bv_len = min_t(int, bytes, PAGE_SIZE - start), bvec_set_page(&bvecs[bvec_idx], pages[idx], len, start);
.bv_offset = start, bytes -= len;
};
bvecs[bvec_idx] = bv;
bytes -= bv.bv_len;
start = 0; start = 0;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment