From 48b0e79ae31ef9421a9cba1ec08644a22c947533 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Fri, 7 Aug 2009 15:37:45 -0700 Subject: [PATCH] Fix compile against 2.6.25 Signed-off-by: Luis R. Rodriguez --- compat/compat-2.6.26.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/compat/compat-2.6.26.h b/compat/compat-2.6.26.h index d21a3cd30253..1bf82353f5af 100644 --- a/compat/compat-2.6.26.h +++ b/compat/compat-2.6.26.h @@ -10,8 +10,27 @@ #include #include #include +#include #include +/* These jiffie helpers added as of 2.6.26 */ + +/* + * These four macros compare jiffies and 'a' for convenience. + */ + +/* time_is_before_jiffies(a) return true if a is before jiffies */ +#define time_is_before_jiffies(a) time_after(jiffies, a) + +/* time_is_after_jiffies(a) return true if a is after jiffies */ +#define time_is_after_jiffies(a) time_before(jiffies, a) + +/* time_is_before_eq_jiffies(a) return true if a is before or equal to jiffies*/ +#define time_is_before_eq_jiffies(a) time_after_eq(jiffies, a) + +/* time_is_after_eq_jiffies(a) return true if a is after or equal to jiffies*/ +#define time_is_after_eq_jiffies(a) time_before_eq(jiffies, a) + /* This comes from include/linux/input.h */ #define SW_RFKILL_ALL 0x03 /* rfkill master switch, type "any" set = radio enabled */ @@ -106,6 +125,25 @@ int net_eq(const struct net *net1, const struct net *net2) } #endif +static inline +void dev_net_set(struct net_device *dev, struct net *net) +{ +#ifdef CONFIG_NET_NS + release_net(dev->nd_net); + dev->nd_net = hold_net(net); +#endif +} + +static inline +struct net *sock_net(const struct sock *sk) +{ +#ifdef CONFIG_NET_NS + return sk->sk_net; +#else + return &init_net; +#endif +} + /* This comes from include/linux/netdevice.h */ /* -- 2.30.2