diff options
| author | Ilpo Järvinen <[email protected]> | 2007-06-15 09:58:38 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2007-10-10 23:47:54 +0000 |
| commit | af610b4ca19f513a50d47ea93ed57241383c8081 (patch) | |
| tree | b7bc4e7f7969b10a2a8d3e3de7375f64df93dd4e /net/ipv4/tcp_output.c | |
| parent | [TCP]: Move code from tcp_ecn.h to tcp*.c and tcp.h & remove it (diff) | |
| download | kernel-af610b4ca19f513a50d47ea93ed57241383c8081.tar.gz kernel-af610b4ca19f513a50d47ea93ed57241383c8081.zip | |
[TCP]: Add tcp_dec_pcount_approx int variant
Signed-off-by: Ilpo Järvinen <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/ipv4/tcp_output.c')
| -rw-r--r-- | net/ipv4/tcp_output.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 3abe22e4b576..3c8c8e7f6f6d 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -740,22 +740,16 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss if (diff > 0) { /* Adjust Reno SACK estimate. */ if (!tp->rx_opt.sack_ok) { - tp->sacked_out -= diff; - if ((int)tp->sacked_out < 0) - tp->sacked_out = 0; + tcp_dec_pcount_approx_int(&tp->sacked_out, diff); tcp_sync_left_out(tp); } - tp->fackets_out -= diff; - if ((int)tp->fackets_out < 0) - tp->fackets_out = 0; + tcp_dec_pcount_approx_int(&tp->fackets_out, diff); /* SACK fastpath might overwrite it unless dealt with */ if (tp->fastpath_skb_hint != NULL && after(TCP_SKB_CB(tp->fastpath_skb_hint)->seq, TCP_SKB_CB(skb)->seq)) { - tp->fastpath_cnt_hint -= diff; - if ((int)tp->fastpath_cnt_hint < 0) - tp->fastpath_cnt_hint = 0; + tcp_dec_pcount_approx_int(&tp->fastpath_cnt_hint, diff); } } } |
