diff options
| author | Eric Dumazet <edumazet@google.com> | 2015-03-17 21:32:29 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-03-17 22:01:56 -0400 |
| commit | 9439ce00f208d95703a6725e4ea986dd90e37ffd (patch) | |
| tree | 734c4448ed923710ea05b3729bcdb3a6c09db46e /net/core | |
| parent | 4e9a578e5b6bdfa8b7fed7a41f28a86a7cffc85f (diff) | |
tcp: rename struct tcp_request_sock listener
The listener field in struct tcp_request_sock is a pointer
back to the listener. We now have req->rsk_listener, so TCP
only needs one boolean and not a full pointer.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
| -rw-r--r-- | net/core/request_sock.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/net/core/request_sock.c b/net/core/request_sock.c index e910317ef6d9..cc39a2aa663a 100644 --- a/net/core/request_sock.c +++ b/net/core/request_sock.c | |||
| @@ -153,24 +153,22 @@ void reqsk_queue_destroy(struct request_sock_queue *queue) | |||
| 153 | * case might also exist in tcp_v4_hnd_req() that will trigger this locking | 153 | * case might also exist in tcp_v4_hnd_req() that will trigger this locking |
| 154 | * order. | 154 | * order. |
| 155 | * | 155 | * |
| 156 | * When a TFO req is created, it needs to sock_hold its listener to prevent | 156 | * This function also sets "treq->tfo_listener" to false. |
| 157 | * the latter data structure from going away. | 157 | * treq->tfo_listener is used by the listener so it is protected by the |
| 158 | * | ||
| 159 | * This function also sets "treq->listener" to NULL and unreference listener | ||
| 160 | * socket. treq->listener is used by the listener so it is protected by the | ||
| 161 | * fastopenq->lock in this function. | 158 | * fastopenq->lock in this function. |
| 162 | */ | 159 | */ |
| 163 | void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req, | 160 | void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req, |
| 164 | bool reset) | 161 | bool reset) |
| 165 | { | 162 | { |
| 166 | struct sock *lsk = tcp_rsk(req)->listener; | 163 | struct sock *lsk = req->rsk_listener; |
| 167 | struct fastopen_queue *fastopenq = | 164 | struct fastopen_queue *fastopenq; |
| 168 | inet_csk(lsk)->icsk_accept_queue.fastopenq; | 165 | |
| 166 | fastopenq = inet_csk(lsk)->icsk_accept_queue.fastopenq; | ||
| 169 | 167 | ||
| 170 | tcp_sk(sk)->fastopen_rsk = NULL; | 168 | tcp_sk(sk)->fastopen_rsk = NULL; |
| 171 | spin_lock_bh(&fastopenq->lock); | 169 | spin_lock_bh(&fastopenq->lock); |
| 172 | fastopenq->qlen--; | 170 | fastopenq->qlen--; |
| 173 | tcp_rsk(req)->listener = NULL; | 171 | tcp_rsk(req)->tfo_listener = false; |
| 174 | if (req->sk) /* the child socket hasn't been accepted yet */ | 172 | if (req->sk) /* the child socket hasn't been accepted yet */ |
| 175 | goto out; | 173 | goto out; |
| 176 | 174 | ||
| @@ -179,7 +177,6 @@ void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req, | |||
| 179 | * special RST handling below. | 177 | * special RST handling below. |
| 180 | */ | 178 | */ |
| 181 | spin_unlock_bh(&fastopenq->lock); | 179 | spin_unlock_bh(&fastopenq->lock); |
| 182 | sock_put(lsk); | ||
| 183 | reqsk_put(req); | 180 | reqsk_put(req); |
| 184 | return; | 181 | return; |
| 185 | } | 182 | } |
| @@ -201,5 +198,4 @@ void reqsk_fastopen_remove(struct sock *sk, struct request_sock *req, | |||
| 201 | fastopenq->qlen++; | 198 | fastopenq->qlen++; |
| 202 | out: | 199 | out: |
| 203 | spin_unlock_bh(&fastopenq->lock); | 200 | spin_unlock_bh(&fastopenq->lock); |
| 204 | sock_put(lsk); | ||
| 205 | } | 201 | } |
