summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2007-06-15 12:58:38 +0300
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 16:47:54 -0700
commitaf610b4ca19f513a50d47ea93ed57241383c8081 (patch)
treeb7bc4e7f7969b10a2a8d3e3de7375f64df93dd4e /include
parentbdf1ee5d3bd38d0c44bd7baa74e07adcbe4ceab1 (diff)
downloadop-kernel-dev-af610b4ca19f513a50d47ea93ed57241383c8081.zip
op-kernel-dev-af610b4ca19f513a50d47ea93ed57241383c8081.tar.gz
[TCP]: Add tcp_dec_pcount_approx int variant
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/tcp.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index dde04af..9d3438f 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -599,16 +599,21 @@ static inline int tcp_skb_mss(const struct sk_buff *skb)
return skb_shinfo(skb)->gso_size;
}
-static inline void tcp_dec_pcount_approx(__u32 *count,
- const struct sk_buff *skb)
+static inline void tcp_dec_pcount_approx_int(__u32 *count, const int decr)
{
if (*count) {
- *count -= tcp_skb_pcount(skb);
+ *count -= decr;
if ((int)*count < 0)
*count = 0;
}
}
+static inline void tcp_dec_pcount_approx(__u32 *count,
+ const struct sk_buff *skb)
+{
+ tcp_dec_pcount_approx_int(count, tcp_skb_pcount(skb));
+}
+
static inline void tcp_packets_out_inc(struct sock *sk,
const struct sk_buff *skb)
{
OpenPOWER on IntegriCloud