提交 8fc92b7c 编写于 作者: A Arseny Krasnov 提交者: Michael S. Tsirkin

af_vsock: rename variables in receive loop

Record is supported via MSG_EOR flag, while current logic operates
with message, so rename variables from 'record' to 'message'.
Signed-off-by: NArseny Krasnov <arseny.krasnov@kaspersky.com>
Reviewed-by: NStefano Garzarella <sgarzare@redhat.com>
Link: https://lore.kernel.org/r/20210903123306.3273757-1-arseny.krasnov@kaspersky.comSigned-off-by: NMichael S. Tsirkin <mst@redhat.com>
上级 8d5ac871
...@@ -2014,7 +2014,7 @@ static int __vsock_seqpacket_recvmsg(struct sock *sk, struct msghdr *msg, ...@@ -2014,7 +2014,7 @@ static int __vsock_seqpacket_recvmsg(struct sock *sk, struct msghdr *msg,
{ {
const struct vsock_transport *transport; const struct vsock_transport *transport;
struct vsock_sock *vsk; struct vsock_sock *vsk;
ssize_t record_len; ssize_t msg_len;
long timeout; long timeout;
int err = 0; int err = 0;
DEFINE_WAIT(wait); DEFINE_WAIT(wait);
...@@ -2028,9 +2028,9 @@ static int __vsock_seqpacket_recvmsg(struct sock *sk, struct msghdr *msg, ...@@ -2028,9 +2028,9 @@ static int __vsock_seqpacket_recvmsg(struct sock *sk, struct msghdr *msg,
if (err <= 0) if (err <= 0)
goto out; goto out;
record_len = transport->seqpacket_dequeue(vsk, msg, flags); msg_len = transport->seqpacket_dequeue(vsk, msg, flags);
if (record_len < 0) { if (msg_len < 0) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
} }
...@@ -2044,14 +2044,14 @@ static int __vsock_seqpacket_recvmsg(struct sock *sk, struct msghdr *msg, ...@@ -2044,14 +2044,14 @@ static int __vsock_seqpacket_recvmsg(struct sock *sk, struct msghdr *msg,
* packet. * packet.
*/ */
if (flags & MSG_TRUNC) if (flags & MSG_TRUNC)
err = record_len; err = msg_len;
else else
err = len - msg_data_left(msg); err = len - msg_data_left(msg);
/* Always set MSG_TRUNC if real length of packet is /* Always set MSG_TRUNC if real length of packet is
* bigger than user's buffer. * bigger than user's buffer.
*/ */
if (record_len > len) if (msg_len > len)
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册