summaryrefslogtreecommitdiff
path: root/net/vmw_vsock/vmci_transport.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2016-07-28 17:36:31 +0300
committerMichael S. Tsirkin <mst@redhat.com>2016-08-02 02:57:28 +0300
commit6773b7dc39f165bd9d824b50ac52cbb3f87d53c8 (patch)
treeeec9a1d84ed6d1c3113cd35c47887d6dd42d4448 /net/vmw_vsock/vmci_transport.c
parent0b01aeb3d2fbf16787f0c9629f4ca52ae792f732 (diff)
downloadlinux-6773b7dc39f165bd9d824b50ac52cbb3f87d53c8.tar.xz
VSOCK: defer sock removal to transports
The virtio transport will implement graceful shutdown and the related SO_LINGER socket option. This requires orphaning the sock but keeping it in the table of connections after .release(). This patch adds the vsock_remove_sock() function and leaves it up to the transport when to remove the sock. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'net/vmw_vsock/vmci_transport.c')
-rw-r--r--net/vmw_vsock/vmci_transport.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c
index 4120b7a538be..4be4fbbc0b50 100644
--- a/net/vmw_vsock/vmci_transport.c
+++ b/net/vmw_vsock/vmci_transport.c
@@ -1644,6 +1644,8 @@ static void vmci_transport_destruct(struct vsock_sock *vsk)
static void vmci_transport_release(struct vsock_sock *vsk)
{
+ vsock_remove_sock(vsk);
+
if (!vmci_handle_is_invalid(vmci_trans(vsk)->dg_handle)) {
vmci_datagram_destroy_handle(vmci_trans(vsk)->dg_handle);
vmci_trans(vsk)->dg_handle = VMCI_INVALID_HANDLE;