Commit efde918a authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

rxrpc: 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>
Acked-by: default avatarDavid Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/r/20230203150634.3199647-21-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 8976fa6d
...@@ -493,7 +493,7 @@ static int rxperf_deliver_request(struct rxperf_call *call) ...@@ -493,7 +493,7 @@ static int rxperf_deliver_request(struct rxperf_call *call)
static int rxperf_process_call(struct rxperf_call *call) static int rxperf_process_call(struct rxperf_call *call)
{ {
struct msghdr msg = {}; struct msghdr msg = {};
struct bio_vec bv[1]; struct bio_vec bv;
struct kvec iov[1]; struct kvec iov[1];
ssize_t n; ssize_t n;
size_t reply_len = call->reply_len, len; size_t reply_len = call->reply_len, len;
...@@ -503,10 +503,8 @@ static int rxperf_process_call(struct rxperf_call *call) ...@@ -503,10 +503,8 @@ static int rxperf_process_call(struct rxperf_call *call)
while (reply_len > 0) { while (reply_len > 0) {
len = min_t(size_t, reply_len, PAGE_SIZE); len = min_t(size_t, reply_len, PAGE_SIZE);
bv[0].bv_page = ZERO_PAGE(0); bvec_set_page(&bv, ZERO_PAGE(0), len, 0);
bv[0].bv_offset = 0; iov_iter_bvec(&msg.msg_iter, WRITE, &bv, 1, len);
bv[0].bv_len = len;
iov_iter_bvec(&msg.msg_iter, WRITE, bv, 1, len);
msg.msg_flags = MSG_MORE; msg.msg_flags = MSG_MORE;
n = rxrpc_kernel_send_data(rxperf_socket, call->rxcall, &msg, n = rxrpc_kernel_send_data(rxperf_socket, call->rxcall, &msg,
len, rxperf_notify_end_reply_tx); len, rxperf_notify_end_reply_tx);
......
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