vmci_transport: switch ->enqeue_dgram, ->enqueue_stream and ->dequeue_stream to msghdr
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 20 Nov 2014 09:05:34 +0000 (04:05 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 24 Nov 2014 10:16:42 +0000 (05:16 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
include/net/af_vsock.h
net/vmw_vsock/af_vsock.c
net/vmw_vsock/vmci_transport.c

index 4282778694006034bccca4ce3fbeba9be29537ec..0d87674fb7758736d9cdbf466fd717c5665f535e 100644 (file)
@@ -103,14 +103,14 @@ struct vsock_transport {
        int (*dgram_dequeue)(struct kiocb *kiocb, struct vsock_sock *vsk,
                             struct msghdr *msg, size_t len, int flags);
        int (*dgram_enqueue)(struct vsock_sock *, struct sockaddr_vm *,
-                            struct iovec *, size_t len);
+                            struct msghdr *, size_t len);
        bool (*dgram_allow)(u32 cid, u32 port);
 
        /* STREAM. */
        /* TODO: stream_bind() */
-       ssize_t (*stream_dequeue)(struct vsock_sock *, struct iovec *,
+       ssize_t (*stream_dequeue)(struct vsock_sock *, struct msghdr *,
                                  size_t len, int flags);
-       ssize_t (*stream_enqueue)(struct vsock_sock *, struct iovec *,
+       ssize_t (*stream_enqueue)(struct vsock_sock *, struct msghdr *,
                                  size_t len);
        s64 (*stream_has_data)(struct vsock_sock *);
        s64 (*stream_has_space)(struct vsock_sock *);
index 85d232bed87d21f3c23cd695b83defef5a6f22c1..1d0e39c9a3e2a5deb62130bc7fbdc31a4b5288a9 100644 (file)
@@ -1013,7 +1013,7 @@ static int vsock_dgram_sendmsg(struct kiocb *kiocb, struct socket *sock,
                goto out;
        }
 
-       err = transport->dgram_enqueue(vsk, remote_addr, msg->msg_iov, len);
+       err = transport->dgram_enqueue(vsk, remote_addr, msg, len);
 
 out:
        release_sock(sk);
@@ -1617,7 +1617,7 @@ static int vsock_stream_sendmsg(struct kiocb *kiocb, struct socket *sock,
                 */
 
                written = transport->stream_enqueue(
-                               vsk, msg->msg_iov,
+                               vsk, msg,
                                len - total_written);
                if (written < 0) {
                        err = -ENOMEM;
@@ -1739,7 +1739,7 @@ vsock_stream_recvmsg(struct kiocb *kiocb,
                                break;
 
                        read = transport->stream_dequeue(
-                                       vsk, msg->msg_iov,
+                                       vsk, msg,
                                        len - copied, flags);
                        if (read < 0) {
                                err = -ENOMEM;
index a57ddef7d5afcf295b2e4579bb59351b22d6b0aa..c1c03895297369089ca1eb765803518cfb55aceb 100644 (file)
@@ -1697,7 +1697,7 @@ static int vmci_transport_dgram_bind(struct vsock_sock *vsk,
 static int vmci_transport_dgram_enqueue(
        struct vsock_sock *vsk,
        struct sockaddr_vm *remote_addr,
-       struct iovec *iov,
+       struct msghdr *msg,
        size_t len)
 {
        int err;
@@ -1714,7 +1714,7 @@ static int vmci_transport_dgram_enqueue(
        if (!dg)
                return -ENOMEM;
 
-       memcpy_fromiovec(VMCI_DG_PAYLOAD(dg), iov, len);
+       memcpy_from_msg(VMCI_DG_PAYLOAD(dg), msg, len);
 
        dg->dst = vmci_make_handle(remote_addr->svm_cid,
                                   remote_addr->svm_port);
@@ -1835,22 +1835,22 @@ static int vmci_transport_connect(struct vsock_sock *vsk)
 
 static ssize_t vmci_transport_stream_dequeue(
        struct vsock_sock *vsk,
-       struct iovec *iov,
+       struct msghdr *msg,
        size_t len,
        int flags)
 {
        if (flags & MSG_PEEK)
-               return vmci_qpair_peekv(vmci_trans(vsk)->qpair, iov, len, 0);
+               return vmci_qpair_peekv(vmci_trans(vsk)->qpair, msg->msg_iov, len, 0);
        else
-               return vmci_qpair_dequev(vmci_trans(vsk)->qpair, iov, len, 0);
+               return vmci_qpair_dequev(vmci_trans(vsk)->qpair, msg->msg_iov, len, 0);
 }
 
 static ssize_t vmci_transport_stream_enqueue(
        struct vsock_sock *vsk,
-       struct iovec *iov,
+       struct msghdr *msg,
        size_t len)
 {
-       return vmci_qpair_enquev(vmci_trans(vsk)->qpair, iov, len, 0);
+       return vmci_qpair_enquev(vmci_trans(vsk)->qpair, msg->msg_iov, len, 0);
 }
 
 static s64 vmci_transport_stream_has_data(struct vsock_sock *vsk)