History

vsock: remove vm_sockets_get_local_cid()

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.

Stefano Garzarella committed 7 years ago

Commit db205c71 parent 7ed78bc3 files · +1 −13Browse files

Unified · Split

3 files
  1. include/linux/vm_sockets.h +0 −2
  2. net/vmw_vsock/af_vsock.c +0 −10
  3. net/vmw_vsock/virtio_transport_common.c +1 −1
include/linux/vm_sockets.h+0−2
@@ -10,6 +10,4 @@ · 9 unmodified lines
10 10
11#include <uapi/linux/vm_sockets.h>11#include <uapi/linux/vm_sockets.h>
12 12
13int vm_sockets_get_local_cid(void);
14
15#endif /* _VM_SOCKETS_H */13#endif /* _VM_SOCKETS_H */
net/vmw_vsock/af_vsock.c+0−10
@@ -129,16 +129,6 @@ static struct proto vsock_proto = { · 128 unmodified lines
129static const struct vsock_transport *transport;129static const struct vsock_transport *transport;
130static DEFINE_MUTEX(vsock_register_mutex);130static DEFINE_MUTEX(vsock_register_mutex);
131 131
132/**** EXPORTS ****/
133
134/* Get the ID of the local context. This is transport dependent. */
135
136int vm_sockets_get_local_cid(void)
137{
138 return transport->get_local_cid();
139}
140EXPORT_SYMBOL_GPL(vm_sockets_get_local_cid);
141
142/**** UTILS ****/132/**** UTILS ****/
143 133
144/* Each bound VSocket is stored in the bind hash table and each connected134/* Each bound VSocket is stored in the bind hash table and each connected
net/vmw_vsock/virtio_transport_common.c+1−1
@@ -168,7 +168,7 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk, · 167 unmodified lines
168 struct virtio_vsock_pkt *pkt;168 struct virtio_vsock_pkt *pkt;
169 u32 pkt_len = info->pkt_len;169 u32 pkt_len = info->pkt_len;
170 170
171 src_cid = vm_sockets_get_local_cid();171 src_cid = virtio_transport_get_ops()->transport.get_local_cid();
172 src_port = vsk->local_addr.svm_port;172 src_port = vsk->local_addr.svm_port;
173 if (!info->remote_cid) {173 if (!info->remote_cid) {
174 dst_cid = vsk->remote_addr.svm_cid;174 dst_cid = vsk->remote_addr.svm_cid;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t