diff options
author | Eric Dumazet <edumazet@google.com> | 2021-10-27 23:19:18 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-28 14:44:38 +0300 |
commit | 27728ba80f1eb279b209bbd5922fdeebe52d9e30 (patch) | |
tree | 267ae3ab21c96c03ec52384c399cb3187c3742c1 /net/ipv4/tcp.c | |
parent | 3ded97bc41a1e76e1e72eeb192331c01ceacc4bc (diff) | |
download | linux-27728ba80f1eb279b209bbd5922fdeebe52d9e30.tar.xz |
tcp: cleanup tcp_remove_empty_skb() use
All tcp_remove_empty_skb() callers now use tcp_write_queue_tail()
for the skb argument, we can therefore factorize code.
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.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 4053ace0cd76..68b946cfd433 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -933,8 +933,10 @@ int tcp_send_mss(struct sock *sk, int *size_goal, int flags) * importantly be able to generate EPOLLOUT for Edge Trigger epoll() * users. */ -void tcp_remove_empty_skb(struct sock *sk, struct sk_buff *skb) +void tcp_remove_empty_skb(struct sock *sk) { + struct sk_buff *skb = tcp_write_queue_tail(sk); + if (skb && TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq) { tcp_unlink_write_queue(skb, sk); if (tcp_write_queue_empty(sk)) @@ -1087,7 +1089,7 @@ out: return copied; do_error: - tcp_remove_empty_skb(sk, tcp_write_queue_tail(sk)); + tcp_remove_empty_skb(sk); if (copied) goto out; out_err: @@ -1408,8 +1410,7 @@ out_nopush: return copied + copied_syn; do_error: - skb = tcp_write_queue_tail(sk); - tcp_remove_empty_skb(sk, skb); + tcp_remove_empty_skb(sk); if (copied + copied_syn) goto out; |