Commit 181a46a5 authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki Committed by David S. Miller

[NETFILTER]: Use macro for spinlock_t/rwlock_t initializations/definition.

Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 196433c5
...@@ -98,7 +98,7 @@ struct nf_ct_frag6_queue ...@@ -98,7 +98,7 @@ struct nf_ct_frag6_queue
#define FRAG6Q_HASHSZ 64 #define FRAG6Q_HASHSZ 64
static struct nf_ct_frag6_queue *nf_ct_frag6_hash[FRAG6Q_HASHSZ]; static struct nf_ct_frag6_queue *nf_ct_frag6_hash[FRAG6Q_HASHSZ];
static rwlock_t nf_ct_frag6_lock = RW_LOCK_UNLOCKED; static DEFINE_RWLOCK(nf_ct_frag6_lock);
static u32 nf_ct_frag6_hash_rnd; static u32 nf_ct_frag6_hash_rnd;
static LIST_HEAD(nf_ct_frag6_lru_list); static LIST_HEAD(nf_ct_frag6_lru_list);
int nf_ct_frag6_nqueues = 0; int nf_ct_frag6_nqueues = 0;
...@@ -371,7 +371,7 @@ nf_ct_frag6_create(unsigned int hash, u32 id, struct in6_addr *src, struct ...@@ -371,7 +371,7 @@ nf_ct_frag6_create(unsigned int hash, u32 id, struct in6_addr *src, struct
init_timer(&fq->timer); init_timer(&fq->timer);
fq->timer.function = nf_ct_frag6_expire; fq->timer.function = nf_ct_frag6_expire;
fq->timer.data = (long) fq; fq->timer.data = (long) fq;
fq->lock = SPIN_LOCK_UNLOCKED; spin_lock_init(&fq->lock);
atomic_set(&fq->refcnt, 1); atomic_set(&fq->refcnt, 1);
return nf_ct_frag6_intern(hash, fq); return nf_ct_frag6_intern(hash, fq);
......
...@@ -151,7 +151,7 @@ instance_create(u_int16_t group_num, int pid) ...@@ -151,7 +151,7 @@ instance_create(u_int16_t group_num, int pid)
goto out_unlock; goto out_unlock;
INIT_HLIST_NODE(&inst->hlist); INIT_HLIST_NODE(&inst->hlist);
inst->lock = SPIN_LOCK_UNLOCKED; spin_lock_init(&inst->lock);
/* needs to be two, since we _put() after creation */ /* needs to be two, since we _put() after creation */
atomic_set(&inst->use, 2); atomic_set(&inst->use, 2);
......
...@@ -148,7 +148,7 @@ instance_create(u_int16_t queue_num, int pid) ...@@ -148,7 +148,7 @@ instance_create(u_int16_t queue_num, int pid)
atomic_set(&inst->id_sequence, 0); atomic_set(&inst->id_sequence, 0);
/* needs to be two, since we _put() after creation */ /* needs to be two, since we _put() after creation */
atomic_set(&inst->use, 2); atomic_set(&inst->use, 2);
inst->lock = SPIN_LOCK_UNLOCKED; spin_lock_init(&inst->lock);
INIT_LIST_HEAD(&inst->queue_list); INIT_LIST_HEAD(&inst->queue_list);
if (!try_module_get(THIS_MODULE)) if (!try_module_get(THIS_MODULE))
......
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