]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
vsock: remove vm_sockets_get_local_cid()
authorStefano Garzarella <sgarzare@redhat.com>
Thu, 14 Nov 2019 09:57:37 +0000 (10:57 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Nov 2019 02:12:17 +0000 (18:12 -0800)
vm_sockets_get_local_cid() is only used in virtio_transport_common.c.
We can replace it calling the virtio_transport_get_ops() and
using the get_local_cid() callback registered by the transport.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Jorgen Hansen <jhansen@vmware.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/vm_sockets.h
net/vmw_vsock/af_vsock.c
net/vmw_vsock/virtio_transport_common.c

index 33f1a2ecd9051585cb84b31ceaa7b15c185c0d21..7dd899ccb920a31114af6ccf56116bc39788092b 100644 (file)
@@ -10,6 +10,4 @@
 
 #include <uapi/linux/vm_sockets.h>
 
-int vm_sockets_get_local_cid(void);
-
 #endif /* _VM_SOCKETS_H */
index 1f4fde4711b6177f859efb267c7a9c046d1ba60a..eb13693e9d04db778c78895e903aa5f53c832bd3 100644 (file)
@@ -129,16 +129,6 @@ static struct proto vsock_proto = {
 static const struct vsock_transport *transport;
 static DEFINE_MUTEX(vsock_register_mutex);
 
-/**** EXPORTS ****/
-
-/* Get the ID of the local context.  This is transport dependent. */
-
-int vm_sockets_get_local_cid(void)
-{
-       return transport->get_local_cid();
-}
-EXPORT_SYMBOL_GPL(vm_sockets_get_local_cid);
-
 /**** UTILS ****/
 
 /* Each bound VSocket is stored in the bind hash table and each connected
index 828edd88488c92287440d7db0dfb0df30c95c49d..3edc373d2acc698fb04ba96a2683786526539521 100644 (file)
@@ -168,7 +168,7 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk,
        struct virtio_vsock_pkt *pkt;
        u32 pkt_len = info->pkt_len;
 
-       src_cid = vm_sockets_get_local_cid();
+       src_cid = virtio_transport_get_ops()->transport.get_local_cid();
        src_port = vsk->local_addr.svm_port;
        if (!info->remote_cid) {
                dst_cid = vsk->remote_addr.svm_cid;