netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [IPv6] fib: initialize tb6_lock in common place to give lockdep a key
@ 2006-10-20 12:42 Thomas Graf
  2006-10-22  3:21 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Graf @ 2006-10-20 12:42 UTC (permalink / raw)
  To: davem; +Cc: yoshfuji, netdev


Signed-off-by: Thomas Graf <tgraf@suug.ch>

Index: net-2.6/net/ipv6/ip6_fib.c
===================================================================
--- net-2.6.orig/net/ipv6/ip6_fib.c	2006-10-20 12:33:57.000000000 +0200
+++ net-2.6/net/ipv6/ip6_fib.c	2006-10-20 12:39:13.000000000 +0200
@@ -169,7 +169,6 @@
 
 static struct fib6_table fib6_main_tbl = {
 	.tb6_id		= RT6_TABLE_MAIN,
-	.tb6_lock	= RW_LOCK_UNLOCKED,
 	.tb6_root	= {
 		.leaf		= &ip6_null_entry,
 		.fn_flags	= RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO,
@@ -187,6 +186,12 @@
 {
 	unsigned int h;
 
+	/*
+	 * Initialize table lock at a single place to give lockdep a key,
+	 * tables aren't visible prior to being linked to the list.
+	 */
+	rwlock_init(&tb->tb6_lock);
+
 	h = tb->tb6_id & (FIB_TABLE_HASHSZ - 1);
 
 	/*
@@ -199,7 +204,6 @@
 #ifdef CONFIG_IPV6_MULTIPLE_TABLES
 static struct fib6_table fib6_local_tbl = {
 	.tb6_id		= RT6_TABLE_LOCAL,
-	.tb6_lock	= RW_LOCK_UNLOCKED,
 	.tb6_root 	= {
 		.leaf		= &ip6_null_entry,
 		.fn_flags	= RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO,
@@ -213,7 +217,6 @@
 	table = kzalloc(sizeof(*table), GFP_ATOMIC);
 	if (table != NULL) {
 		table->tb6_id = id;
-		table->tb6_lock = RW_LOCK_UNLOCKED;
 		table->tb6_root.leaf = &ip6_null_entry;
 		table->tb6_root.fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO;
 	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [IPv6] fib: initialize tb6_lock in common place to give lockdep a key
  2006-10-20 12:42 [IPv6] fib: initialize tb6_lock in common place to give lockdep a key Thomas Graf
@ 2006-10-22  3:21 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2006-10-22  3:21 UTC (permalink / raw)
  To: tgraf; +Cc: yoshfuji, netdev

From: Thomas Graf <tgraf@suug.ch>
Date: Fri, 20 Oct 2006 14:42:04 +0200

> Signed-off-by: Thomas Graf <tgraf@suug.ch>

Applied, thanks a lot for this fix Thomas.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-10-22  3:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-20 12:42 [IPv6] fib: initialize tb6_lock in common place to give lockdep a key Thomas Graf
2006-10-22  3:21 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).