aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2017-10-06 01:21:23 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-06 19:28:53 -0400
commit4e8cc22803080853a33bafc6748e133448fb8182 (patch)
treee4f36b483b30a1975f40660028f9e47e2cba9b3f /net/ipv4/tcp.c
parentac3f09ba3e496bd7cc780ead05b1d1bb5f33aedb (diff)
tcp: tcp_tx_timestamp() cleanup
tcp_write_queue_tail() call can be factorized. 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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index f8ebae62f834..b8d379c80936 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -469,8 +469,10 @@ void tcp_init_transfer(struct sock *sk, int bpf_op)
469 tcp_init_buffer_space(sk); 469 tcp_init_buffer_space(sk);
470} 470}
471 471
472static void tcp_tx_timestamp(struct sock *sk, u16 tsflags, struct sk_buff *skb) 472static void tcp_tx_timestamp(struct sock *sk, u16 tsflags)
473{ 473{
474 struct sk_buff *skb = tcp_write_queue_tail(sk);
475
474 if (tsflags && skb) { 476 if (tsflags && skb) {
475 struct skb_shared_info *shinfo = skb_shinfo(skb); 477 struct skb_shared_info *shinfo = skb_shinfo(skb);
476 struct tcp_skb_cb *tcb = TCP_SKB_CB(skb); 478 struct tcp_skb_cb *tcb = TCP_SKB_CB(skb);
@@ -1041,7 +1043,7 @@ wait_for_memory:
1041 1043
1042out: 1044out:
1043 if (copied) { 1045 if (copied) {
1044 tcp_tx_timestamp(sk, sk->sk_tsflags, tcp_write_queue_tail(sk)); 1046 tcp_tx_timestamp(sk, sk->sk_tsflags);
1045 if (!(flags & MSG_SENDPAGE_NOTLAST)) 1047 if (!(flags & MSG_SENDPAGE_NOTLAST))
1046 tcp_push(sk, flags, mss_now, tp->nonagle, size_goal); 1048 tcp_push(sk, flags, mss_now, tp->nonagle, size_goal);
1047 } 1049 }
@@ -1418,7 +1420,7 @@ wait_for_memory:
1418 1420
1419out: 1421out:
1420 if (copied) { 1422 if (copied) {
1421 tcp_tx_timestamp(sk, sockc.tsflags, tcp_write_queue_tail(sk)); 1423 tcp_tx_timestamp(sk, sockc.tsflags);
1422 tcp_push(sk, flags, mss_now, tp->nonagle, size_goal); 1424 tcp_push(sk, flags, mss_now, tp->nonagle, size_goal);
1423 } 1425 }
1424out_nopush: 1426out_nopush: