[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(usagi-users 03547) [PATCH 2.6.14-20051104] Use DEFINE_{SPIN,RW}LOCK()



[ Please CC me, I'm not on this list, thanks! ]

Hello.  The following patch is against linux26-2.6.14-usagi-20051104.patch
This changes all occurances of new spinlock or rwlocks to use the
DEFINE_... macro or spin_lock_init() instead.  This makes integration
with the RealTime patches from Ingo Molnar easier and better matches
kernel.org style.

Signed-off-by: Tom Rini <trini@xxxxxxxxxxxxxxxxxxx>

 net/ipv6/ip6mr.c                         |    4 ++--
 net/ipv6/netfilter/ip6_conntrack_reasm.c |    4 ++--
 net/ipv6/route.c                         |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

Index: linux-2.6.14/net/ipv6/route.c
===================================================================
--- linux-2.6.14.orig/net/ipv6/route.c
+++ linux-2.6.14/net/ipv6/route.c
@@ -217,7 +217,7 @@ static __inline__ struct rt6_info *rt6_d
  */
 #if !defined(CONFIG_IPV6_NEW_ROUNDROBIN)
 struct rt6_info *rt6_dflt_pointer;
-spinlock_t rt6_dflt_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(rt6_dflt_lock);
 
 void rt6_reset_dflt_pointer(struct rt6_info *rt)
 {
Index: linux-2.6.14/net/ipv6/ip6mr.c
===================================================================
--- linux-2.6.14.orig/net/ipv6/ip6mr.c
+++ linux-2.6.14/net/ipv6/ip6mr.c
@@ -80,7 +80,7 @@ struct sock *mroute6_socket;
    Note that the changes are semaphored via rtnl_lock.
  */
 
-static rwlock_t mrt_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(mrt_lock);
 
 /*
  *	Multicast router control variables
@@ -100,7 +100,7 @@ static struct mfc6_cache *mfc_unres_queu
 static atomic_t cache_resolve_queue_len;		/* Size of unresolved	*/
 
 /* Special spinlock for queue of unresolved entries */
-static spinlock_t mfc_unres_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK (mfc_unres_lock);
 
 /* We return to original Alan's scheme. Hash table of resolved
    entries is changed only in process context and protected
Index: linux-2.6.14/net/ipv6/netfilter/ip6_conntrack_reasm.c
===================================================================
--- linux-2.6.14.orig/net/ipv6/netfilter/ip6_conntrack_reasm.c
+++ linux-2.6.14/net/ipv6/netfilter/ip6_conntrack_reasm.c
@@ -104,7 +104,7 @@ struct ip6ct_frag_queue
 #define IP6CT_Q_HASHSZ	64
 
 static struct ip6ct_frag_queue *ip6_ct_frag_hash[IP6CT_Q_HASHSZ];
-static rwlock_t ip6_ct_frag_lock = RW_LOCK_UNLOCKED;
+static DEFINE_RWLOCK(ip6_ct_frag_lock);
 static u32 ip6_ct_frag_hash_rnd;
 static LIST_HEAD(ip6_ct_frag_lru_list);
 int ip6_ct_frag_nqueues = 0;
@@ -366,7 +366,7 @@ ip6_ct_frag_create(unsigned int hash, u3
 	init_timer(&fq->timer);
 	fq->timer.function = ip6_ct_frag_expire;
 	fq->timer.data = (long) fq;
-	fq->lock = SPIN_LOCK_UNLOCKED;
+	spin_lock_init(&fq->lock);
 	atomic_set(&fq->refcnt, 1);
 
 	return ip6_ct_frag_intern(hash, fq);

-- 
Tom Rini
http://gate.crashing.org/~trini/