mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-14 13:39:10 +00:00
Bluetooth: move l2cap_sock_kill() to l2cap_sock.c
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
parent
6ddc0485e1
commit
05fc1576da
@ -753,22 +753,6 @@ static void l2cap_sock_cleanup_listen(struct sock *parent)
|
|||||||
sock_set_flag(parent, SOCK_ZAPPED);
|
sock_set_flag(parent, SOCK_ZAPPED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Kill socket (only if zapped and orphan)
|
|
||||||
* Must be called on unlocked socket.
|
|
||||||
*/
|
|
||||||
void l2cap_sock_kill(struct sock *sk)
|
|
||||||
{
|
|
||||||
if (!sock_flag(sk, SOCK_ZAPPED) || sk->sk_socket)
|
|
||||||
return;
|
|
||||||
|
|
||||||
BT_DBG("sk %p state %d", sk, sk->sk_state);
|
|
||||||
|
|
||||||
/* Kill poor orphan */
|
|
||||||
bt_sock_unlink(&l2cap_sk_list, sk);
|
|
||||||
sock_set_flag(sk, SOCK_DEAD);
|
|
||||||
sock_put(sk);
|
|
||||||
}
|
|
||||||
|
|
||||||
void __l2cap_sock_close(struct sock *sk, int reason)
|
void __l2cap_sock_close(struct sock *sk, int reason)
|
||||||
{
|
{
|
||||||
BT_DBG("sk %p state %d socket %p", sk, sk->sk_state, sk->sk_socket);
|
BT_DBG("sk %p state %d socket %p", sk, sk->sk_state, sk->sk_socket);
|
||||||
|
@ -838,6 +838,22 @@ static int l2cap_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct ms
|
|||||||
return bt_sock_recvmsg(iocb, sock, msg, len, flags);
|
return bt_sock_recvmsg(iocb, sock, msg, len, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Kill socket (only if zapped and orphan)
|
||||||
|
* Must be called on unlocked socket.
|
||||||
|
*/
|
||||||
|
void l2cap_sock_kill(struct sock *sk)
|
||||||
|
{
|
||||||
|
if (!sock_flag(sk, SOCK_ZAPPED) || sk->sk_socket)
|
||||||
|
return;
|
||||||
|
|
||||||
|
BT_DBG("sk %p state %d", sk, sk->sk_state);
|
||||||
|
|
||||||
|
/* Kill poor orphan */
|
||||||
|
bt_sock_unlink(&l2cap_sk_list, sk);
|
||||||
|
sock_set_flag(sk, SOCK_DEAD);
|
||||||
|
sock_put(sk);
|
||||||
|
}
|
||||||
|
|
||||||
static int l2cap_sock_shutdown(struct socket *sock, int how)
|
static int l2cap_sock_shutdown(struct socket *sock, int how)
|
||||||
{
|
{
|
||||||
struct sock *sk = sock->sk;
|
struct sock *sk = sock->sk;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user