mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 20:54:10 +08:00
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>
This commit is contained in:
parent
44f209807e
commit
bf359b8127
@ -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);
|
||||
|
@ -250,16 +250,6 @@ static struct sock *__vsock_find_connected_socket(struct sockaddr_vm *src,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static bool __vsock_in_bound_table(struct vsock_sock *vsk)
|
||||
{
|
||||
return !list_empty(&vsk->bound_table);
|
||||
}
|
||||
|
||||
static bool __vsock_in_connected_table(struct vsock_sock *vsk)
|
||||
{
|
||||
return !list_empty(&vsk->connected_table);
|
||||
}
|
||||
|
||||
static void vsock_insert_unbound(struct vsock_sock *vsk)
|
||||
{
|
||||
spin_lock_bh(&vsock_table_lock);
|
||||
|
Loading…
Reference in New Issue
Block a user