aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2011-02-04 00:26:01 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-02-07 22:43:32 -0500
commit05fc1576dabb1defae3c8c0371fb9d21f7db997a (patch)
tree43c651ceba92013e0cee67f529a1d8defd7a37ab /net/bluetooth
parent6ddc0485e1a6ecd450140ea40ffa52786f99183c (diff)
Bluetooth: move l2cap_sock_kill() to l2cap_sock.c
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/l2cap_core.c16
-rw-r--r--net/bluetooth/l2cap_sock.c16
2 files changed, 16 insertions, 16 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 12abd7ca2825..9d51af300d9c 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -753,22 +753,6 @@ static void l2cap_sock_cleanup_listen(struct sock *parent)
753 sock_set_flag(parent, SOCK_ZAPPED); 753 sock_set_flag(parent, SOCK_ZAPPED);
754} 754}
755 755
756/* Kill socket (only if zapped and orphan)
757 * Must be called on unlocked socket.
758 */
759void l2cap_sock_kill(struct sock *sk)
760{
761 if (!sock_flag(sk, SOCK_ZAPPED) || sk->sk_socket)
762 return;
763
764 BT_DBG("sk %p state %d", sk, sk->sk_state);
765
766 /* Kill poor orphan */
767 bt_sock_unlink(&l2cap_sk_list, sk);
768 sock_set_flag(sk, SOCK_DEAD);
769 sock_put(sk);
770}
771
772void __l2cap_sock_close(struct sock *sk, int reason) 756void __l2cap_sock_close(struct sock *sk, int reason)
773{ 757{
774 BT_DBG("sk %p state %d socket %p", sk, sk->sk_state, sk->sk_socket); 758 BT_DBG("sk %p state %d socket %p", sk, sk->sk_state, sk->sk_socket);
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 23bb968b314a..4b4e0201ebbe 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -838,6 +838,22 @@ static int l2cap_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct ms
838 return bt_sock_recvmsg(iocb, sock, msg, len, flags); 838 return bt_sock_recvmsg(iocb, sock, msg, len, flags);
839} 839}
840 840
841/* Kill socket (only if zapped and orphan)
842 * Must be called on unlocked socket.
843 */
844void l2cap_sock_kill(struct sock *sk)
845{
846 if (!sock_flag(sk, SOCK_ZAPPED) || sk->sk_socket)
847 return;
848
849 BT_DBG("sk %p state %d", sk, sk->sk_state);
850
851 /* Kill poor orphan */
852 bt_sock_unlink(&l2cap_sk_list, sk);
853 sock_set_flag(sk, SOCK_DEAD);
854 sock_put(sk);
855}
856
841static int l2cap_sock_shutdown(struct socket *sock, int how) 857static int l2cap_sock_shutdown(struct socket *sock, int how)
842{ 858{
843 struct sock *sk = sock->sk; 859 struct sock *sk = sock->sk;