aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/vhost/vsock.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2022-09-15 20:25:47 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2022-11-25 13:01:55 -0500
commitde4eda9de2d957ef2d6a8365a01e26a435e958cb (patch)
tree49b0d60dedb65af7f0d3e874ee9c661e6b09697b /drivers/vhost/vsock.c
parentiov_iter: saner checks for attempt to copy to/from iterator (diff)
downloadwireguard-linux-de4eda9de2d957ef2d6a8365a01e26a435e958cb.tar.xz
wireguard-linux-de4eda9de2d957ef2d6a8365a01e26a435e958cb.zip
use less confusing names for iov_iter direction initializers
READ/WRITE proved to be actively confusing - the meanings are "data destination, as used with read(2)" and "data source, as used with write(2)", but people keep interpreting those as "we read data from it" and "we write data to it", i.e. exactly the wrong way. Call them ITER_DEST and ITER_SOURCE - at least that is harder to misinterpret... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/vhost/vsock.c')
-rw-r--r--drivers/vhost/vsock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index 5703775af129..cd6f7776013a 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -165,7 +165,7 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock,
break;
}
- iov_iter_init(&iov_iter, READ, &vq->iov[out], in, iov_len);
+ iov_iter_init(&iov_iter, ITER_DEST, &vq->iov[out], in, iov_len);
payload_len = pkt->len - pkt->off;
/* If the packet is greater than the space available in the
@@ -371,7 +371,7 @@ vhost_vsock_alloc_pkt(struct vhost_virtqueue *vq,
return NULL;
len = iov_length(vq->iov, out);
- iov_iter_init(&iov_iter, WRITE, vq->iov, out, len);
+ iov_iter_init(&iov_iter, ITER_SOURCE, vq->iov, out, len);
nbytes = copy_from_iter(&pkt->hdr, sizeof(pkt->hdr), &iov_iter);
if (nbytes != sizeof(pkt->hdr)) {