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
1010
1111 #include <uapi/linux/vm_sockets.h>
1212
13−int vm_sockets_get_local_cid(void);
14−
1513 #endif /* _VM_SOCKETS_H */
net/vmw_vsock/af_vsock.c+0−10
@@ -129,16 +129,6 @@ static struct proto vsock_proto = { · 128 unmodified lines
129129 static const struct vsock_transport *transport;
130130 static DEFINE_MUTEX(vsock_register_mutex);
131131
132−/**** EXPORTS ****/
133−
134−/* Get the ID of the local context. This is transport dependent. */
135−
136−int vm_sockets_get_local_cid(void)
137−{
138− return transport->get_local_cid();
139−}
140−EXPORT_SYMBOL_GPL(vm_sockets_get_local_cid);
141−
142132 /**** UTILS ****/
143133
144134 /* 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
168168 struct virtio_vsock_pkt *pkt;
169169 u32 pkt_len = info->pkt_len;
170170
171− src_cid = vm_sockets_get_local_cid();
171+ src_cid = virtio_transport_get_ops()->transport.get_local_cid();
172172 src_port = vsk->local_addr.svm_port;
173173 if (!info->remote_cid) {
174174 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