summaryrefslogtreecommitdiff
path: root/net/core/request_sock.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2015-10-02 21:43:24 +0300
committerDavid S. Miller <davem@davemloft.net>2015-10-03 14:32:36 +0300
commitaac065c50aba0c534a929aeb687eb68c58e523b8 (patch)
treeb8817f56e96322e7c855653fe63eced1256c8356 /net/core/request_sock.c
parentfff1f3001cc58b5064a0f1154a7ac09b76f29c44 (diff)
downloadlinux-aac065c50aba0c534a929aeb687eb68c58e523b8.tar.xz
tcp: move qlen/young out of struct listen_sock
qlen_inc & young_inc were protected by listener lock, while qlen_dec & young_dec were atomic fields. Everything needs to be atomic for upcoming lockless listener. Also move qlen/young in request_sock_queue as we'll get rid of struct listen_sock eventually. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/request_sock.c')
-rw-r--r--net/core/request_sock.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/core/request_sock.c b/net/core/request_sock.c
index 8d9fd31d3d06..5ca624cea04c 100644
--- a/net/core/request_sock.c
+++ b/net/core/request_sock.c
@@ -102,7 +102,7 @@ void reqsk_queue_destroy(struct request_sock_queue *queue)
/* make all the listen_opt local to us */
struct listen_sock *lopt = reqsk_queue_yank_listen_sk(queue);
- if (listen_sock_qlen(lopt) != 0) {
+ if (reqsk_queue_len(queue) != 0) {
unsigned int i;
for (i = 0; i < lopt->nr_table_entries; i++) {
@@ -116,7 +116,7 @@ void reqsk_queue_destroy(struct request_sock_queue *queue)
* or risk a dead lock.
*/
spin_unlock_bh(&queue->syn_wait_lock);
- atomic_inc(&lopt->qlen_dec);
+ atomic_dec(&queue->qlen);
if (del_timer_sync(&req->rsk_timer))
reqsk_put(req);
reqsk_put(req);
@@ -126,8 +126,8 @@ void reqsk_queue_destroy(struct request_sock_queue *queue)
}
}
- if (WARN_ON(listen_sock_qlen(lopt) != 0))
- pr_err("qlen %u\n", listen_sock_qlen(lopt));
+ if (WARN_ON(reqsk_queue_len(queue) != 0))
+ pr_err("qlen %u\n", reqsk_queue_len(queue));
kvfree(lopt);
}