From: Jozsef Kadlecsik Date: Tue, 27 Nov 2012 13:19:07 +0000 (+0100) Subject: Backport RCU handling up to 2.6.32.x X-Git-Tag: v6.16.1~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a9ff31b7aa8dbb12c04fdf2b0add6a9966a5cb67;p=ipset Backport RCU handling up to 2.6.32.x __rcu and rcu_dereference_protected is missing from older kernel releases. --- diff --git a/kernel/net/netfilter/ipset/ip_set_core.c b/kernel/net/netfilter/ipset/ip_set_core.c index b58f343..b32912f 100644 --- a/kernel/net/netfilter/ipset/ip_set_core.c +++ b/kernel/net/netfilter/ipset/ip_set_core.c @@ -31,7 +31,11 @@ static LIST_HEAD(ip_set_type_list); /* all registered set types */ static DEFINE_MUTEX(ip_set_type_mutex); /* protects ip_set_type_list */ static DEFINE_RWLOCK(ip_set_ref_lock); /* protects the set refs */ +#ifdef __rcu static struct ip_set * __rcu *ip_set_list; /* all individual sets */ +#else +static struct ip_set **ip_set_list; /* all individual sets */ +#endif static ip_set_id_t ip_set_max = CONFIG_IP_SET_MAX; /* max number of sets */ #define IP_SET_INC 64 @@ -46,6 +50,10 @@ MODULE_AUTHOR("Jozsef Kadlecsik "); MODULE_DESCRIPTION("core IP set support"); MODULE_ALIAS_NFNL_SUBSYS(NFNL_SUBSYS_IPSET); +#ifndef rcu_dereference_protected +#define rcu_dereference_protected(p, c) rcu_dereference(p) +#endif + /* When the nfnl mutex is held: */ #define nfnl_dereference(p) \ rcu_dereference_protected(p, 1)