diff options
author | Christoph Hellwig <hch@lst.de> | 2023-02-03 16:06:34 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-02-03 10:17:43 -0700 |
commit | 1eb9cd15004fa91b6d1911af9fbaff299d8e9e45 (patch) | |
tree | 63561b420d78ad71d57f9c340f8ef0f00ede9eb5 /net/ceph/messenger_v1.c | |
parent | 58dfe14073846e416d5b3595314a4f37e1a89c50 (diff) | |
download | lwn-1eb9cd15004fa91b6d1911af9fbaff299d8e9e45.tar.gz lwn-1eb9cd15004fa91b6d1911af9fbaff299d8e9e45.zip |
libceph: use bvec_set_page to initialize bvecs
Use the bvec_set_page helper to initialize bvecs.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Link: https://lore.kernel.org/r/20230203150634.3199647-24-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'net/ceph/messenger_v1.c')
-rw-r--r-- | net/ceph/messenger_v1.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/ceph/messenger_v1.c b/net/ceph/messenger_v1.c index d1787d7d33ef..d664cb1593a7 100644 --- a/net/ceph/messenger_v1.c +++ b/net/ceph/messenger_v1.c @@ -40,15 +40,12 @@ static int ceph_tcp_recvmsg(struct socket *sock, void *buf, size_t len) static int ceph_tcp_recvpage(struct socket *sock, struct page *page, int page_offset, size_t length) { - struct bio_vec bvec = { - .bv_page = page, - .bv_offset = page_offset, - .bv_len = length - }; + struct bio_vec bvec; struct msghdr msg = { .msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL }; int r; BUG_ON(page_offset + length > PAGE_SIZE); + bvec_set_page(&bvec, page, length, page_offset); iov_iter_bvec(&msg.msg_iter, ITER_DEST, &bvec, 1, length); r = sock_recvmsg(sock, &msg, msg.msg_flags); if (r == -EAGAIN) |