diff options
author | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-05-27 21:27:55 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-06-04 23:34:11 -0400 |
commit | 538266929eb7165f92b91eb0f403120fe759e742 (patch) | |
tree | 1b8076405a9cf11d1eba612e66c0a35d635b090a /net/bluetooth | |
parent | 0797e01d877b9677d07b89e0776c061df8878f27 (diff) |
Bluetooth: Move check for backlog size to l2cap_sock.c
Remove socket specific code from l2cap_core.c
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Acked-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/l2cap_core.c | 12 | ||||
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 6 |
2 files changed, 6 insertions, 12 deletions
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 35e6d7dd329b..d64c836f2bcf 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -1156,12 +1156,6 @@ static void l2cap_le_conn_ready(struct l2cap_conn *conn) | |||
1156 | 1156 | ||
1157 | lock_sock(parent); | 1157 | lock_sock(parent); |
1158 | 1158 | ||
1159 | /* Check for backlog size */ | ||
1160 | if (sk_acceptq_is_full(parent)) { | ||
1161 | BT_DBG("backlog full %d", parent->sk_ack_backlog); | ||
1162 | goto clean; | ||
1163 | } | ||
1164 | |||
1165 | chan = pchan->ops->new_connection(pchan); | 1159 | chan = pchan->ops->new_connection(pchan); |
1166 | if (!chan) | 1160 | if (!chan) |
1167 | goto clean; | 1161 | goto clean; |
@@ -3349,12 +3343,6 @@ static inline int l2cap_connect_req(struct l2cap_conn *conn, struct l2cap_cmd_hd | |||
3349 | 3343 | ||
3350 | result = L2CAP_CR_NO_MEM; | 3344 | result = L2CAP_CR_NO_MEM; |
3351 | 3345 | ||
3352 | /* Check for backlog size */ | ||
3353 | if (sk_acceptq_is_full(parent)) { | ||
3354 | BT_DBG("backlog full %d", parent->sk_ack_backlog); | ||
3355 | goto response; | ||
3356 | } | ||
3357 | |||
3358 | chan = pchan->ops->new_connection(pchan); | 3346 | chan = pchan->ops->new_connection(pchan); |
3359 | if (!chan) | 3347 | if (!chan) |
3360 | goto response; | 3348 | goto response; |
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 5563023001c6..d856cc8f22a3 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -895,6 +895,12 @@ static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan) | |||
895 | { | 895 | { |
896 | struct sock *sk, *parent = chan->data; | 896 | struct sock *sk, *parent = chan->data; |
897 | 897 | ||
898 | /* Check for backlog size */ | ||
899 | if (sk_acceptq_is_full(parent)) { | ||
900 | BT_DBG("backlog full %d", parent->sk_ack_backlog); | ||
901 | return NULL; | ||
902 | } | ||
903 | |||
898 | sk = l2cap_sock_alloc(sock_net(parent), NULL, BTPROTO_L2CAP, | 904 | sk = l2cap_sock_alloc(sock_net(parent), NULL, BTPROTO_L2CAP, |
899 | GFP_ATOMIC); | 905 | GFP_ATOMIC); |
900 | if (!sk) | 906 | if (!sk) |