summaryrefslogtreecommitdiffstats
path: root/include/net/af_vsock.h
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2017-10-05 22:46:51 +0200
committerDavid S. Miller <davem@davemloft.net>2017-10-06 03:44:17 +0200
commitbf359b8127719535f88494adb3c2b73c06667dcd (patch)
treec402517fa7ee2ea538ea3920f33b2629db4e1310 /include/net/af_vsock.h
parentVSOCK: export socket tables for sock_diag interface (diff)
downloadlinux-bf359b8127719535f88494adb3c2b73c06667dcd.tar.xz
linux-bf359b8127719535f88494adb3c2b73c06667dcd.zip
VSOCK: move __vsock_in_bound/connected_table() to af_vsock.h
The vsock_diag.ko module will need to check socket table membership. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/af_vsock.h')
-rw-r--r--include/net/af_vsock.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h
index 30cba806e344..3dd217718a2f 100644
--- a/include/net/af_vsock.h
+++ b/include/net/af_vsock.h
@@ -180,6 +180,18 @@ const struct vsock_transport *vsock_core_get_transport(void);
/**** UTILS ****/
+/* vsock_table_lock must be held */
+static inline bool __vsock_in_bound_table(struct vsock_sock *vsk)
+{
+ return !list_empty(&vsk->bound_table);
+}
+
+/* vsock_table_lock must be held */
+static inline bool __vsock_in_connected_table(struct vsock_sock *vsk)
+{
+ return !list_empty(&vsk->connected_table);
+}
+
void vsock_release_pending(struct sock *pending);
void vsock_add_pending(struct sock *listener, struct sock *pending);
void vsock_remove_pending(struct sock *listener, struct sock *pending);