aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2017-10-06 01:21:22 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-06 19:28:53 -0400
commitac3f09ba3e496bd7cc780ead05b1d1bb5f33aedb (patch)
tree8018874a297838e64f76df8b33a40dc1aeb923e0 /net/ipv4/tcp.c
parent18a4c0eab2623cc95be98a1e6af1ad18e7695977 (diff)
tcp: uninline tcp_write_queue_purge()
Since the upcoming rtx rbtree will add some extra code, it is time to not inline this fat function anymore. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 8cf742fd4f99..f8ebae62f834 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2318,6 +2318,20 @@ static inline bool tcp_need_reset(int state)
2318 TCPF_FIN_WAIT2 | TCPF_SYN_RECV); 2318 TCPF_FIN_WAIT2 | TCPF_SYN_RECV);
2319} 2319}
2320 2320
2321void tcp_write_queue_purge(struct sock *sk)
2322{
2323 struct sk_buff *skb;
2324
2325 tcp_chrono_stop(sk, TCP_CHRONO_BUSY);
2326 while ((skb = __skb_dequeue(&sk->sk_write_queue)) != NULL) {
2327 tcp_skb_tsorted_anchor_cleanup(skb);
2328 sk_wmem_free_skb(sk, skb);
2329 }
2330 INIT_LIST_HEAD(&tcp_sk(sk)->tsorted_sent_queue);
2331 sk_mem_reclaim(sk);
2332 tcp_clear_all_retrans_hints(tcp_sk(sk));
2333}
2334
2321int tcp_disconnect(struct sock *sk, int flags) 2335int tcp_disconnect(struct sock *sk, int flags)
2322{ 2336{
2323 struct inet_sock *inet = inet_sk(sk); 2337 struct inet_sock *inet = inet_sk(sk);