summaryrefslogtreecommitdiffstats
path: root/kernel/include/linux/netfilter/ipset/ip_set_timeout.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/include/linux/netfilter/ipset/ip_set_timeout.h')
-rw-r--r--kernel/include/linux/netfilter/ipset/ip_set_timeout.h32
1 files changed, 9 insertions, 23 deletions
diff --git a/kernel/include/linux/netfilter/ipset/ip_set_timeout.h b/kernel/include/linux/netfilter/ipset/ip_set_timeout.h
index 9e30031..cfe8a3f 100644
--- a/kernel/include/linux/netfilter/ipset/ip_set_timeout.h
+++ b/kernel/include/linux/netfilter/ipset/ip_set_timeout.h
@@ -40,23 +40,9 @@ ip_set_timeout_uget(struct nlattr *tb)
}
static inline bool
-__ip_set_timeout_expired(unsigned long t)
+ip_set_timeout_expired(unsigned long *t)
{
- return t != IPSET_ELEM_PERMANENT && time_is_before_jiffies(t);
-}
-
-static inline bool
-ip_set_timeout_expired_rcu(unsigned long *timeout)
-{
- unsigned long t = ip_set_rcu_deref(*timeout);
-
- return __ip_set_timeout_expired(t);
-}
-
-static inline bool
-ip_set_timeout_expired(unsigned long *timeout)
-{
- return __ip_set_timeout_expired(*timeout);
+ return *t != IPSET_ELEM_PERMANENT && time_is_before_jiffies(*t);
}
static inline void
@@ -64,23 +50,23 @@ ip_set_timeout_set(unsigned long *timeout, u32 value)
{
unsigned long t;
- if (!value)
- return ip_set_rcu_assign_ulong(timeout, IPSET_ELEM_PERMANENT);
+ if (!value) {
+ *timeout = IPSET_ELEM_PERMANENT;
+ return;
+ }
t = msecs_to_jiffies(value * 1000) + jiffies;
if (t == IPSET_ELEM_PERMANENT)
/* Bingo! :-) */
t--;
- ip_set_rcu_assign_ulong(timeout, t);
+ *timeout = t;
}
static inline u32
ip_set_timeout_get(unsigned long *timeout)
{
- unsigned long t = ip_set_rcu_deref(*timeout);
-
- return t == IPSET_ELEM_PERMANENT ? 0 :
- jiffies_to_msecs(t - jiffies)/1000;
+ return *timeout == IPSET_ELEM_PERMANENT ? 0 :
+ jiffies_to_msecs(*timeout - jiffies)/1000;
}
#endif /* __KERNEL__ */