Commit 44b63b0a authored by Li RongQing's avatar Li RongQing Committed by Pablo Neira Ayuso

netfilter: not mark a spinlock as __read_mostly

when spinlock is locked/unlocked, its elements will be changed,
so marking it as __read_mostly is not suitable.

and remove a duplicate definition of nf_conntrack_locks_all_lock
strange that compiler does not complain.
Signed-off-by: default avatarLi RongQing <lirongqing@baidu.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent d0a8d877
...@@ -73,8 +73,7 @@ struct conntrack_gc_work { ...@@ -73,8 +73,7 @@ struct conntrack_gc_work {
}; };
static __read_mostly struct kmem_cache *nf_conntrack_cachep; static __read_mostly struct kmem_cache *nf_conntrack_cachep;
static __read_mostly spinlock_t nf_conntrack_locks_all_lock; static DEFINE_SPINLOCK(nf_conntrack_locks_all_lock);
static __read_mostly DEFINE_SPINLOCK(nf_conntrack_locks_all_lock);
static __read_mostly bool nf_conntrack_locks_all; static __read_mostly bool nf_conntrack_locks_all;
/* every gc cycle scans at most 1/GC_MAX_BUCKETS_DIV part of table */ /* every gc cycle scans at most 1/GC_MAX_BUCKETS_DIV part of table */
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <net/netfilter/nf_conntrack_ecache.h> #include <net/netfilter/nf_conntrack_ecache.h>
#include <net/netfilter/nf_conntrack_labels.h> #include <net/netfilter/nf_conntrack_labels.h>
static __read_mostly DEFINE_SPINLOCK(nf_connlabels_lock); static DEFINE_SPINLOCK(nf_connlabels_lock);
static int replace_u32(u32 *address, u32 mask, u32 new) static int replace_u32(u32 *address, u32 mask, u32 new)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment