Skip to content

Commit

Permalink
vsock: remove vm_sockets_get_local_cid()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefano Garzarella authored and David S. Miller committed Nov 15, 2019
1 parent 7ed78bc commit db205c7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
2 changes: 0 additions & 2 deletions include/linux/vm_sockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,4 @@

#include <uapi/linux/vm_sockets.h>

int vm_sockets_get_local_cid(void);

#endif /* _VM_SOCKETS_H */
10 changes: 0 additions & 10 deletions net/vmw_vsock/af_vsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion net/vmw_vsock/virtio_transport_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit db205c7

Please sign in to comment.