diff options
-rw-r--r-- | net/ipv6/ip6_fib.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index 8fcae7a6510b..f98ca30d7c1f 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c | |||
@@ -169,7 +169,6 @@ static __inline__ void rt6_release(struct rt6_info *rt) | |||
169 | 169 | ||
170 | static struct fib6_table fib6_main_tbl = { | 170 | static struct fib6_table fib6_main_tbl = { |
171 | .tb6_id = RT6_TABLE_MAIN, | 171 | .tb6_id = RT6_TABLE_MAIN, |
172 | .tb6_lock = RW_LOCK_UNLOCKED, | ||
173 | .tb6_root = { | 172 | .tb6_root = { |
174 | .leaf = &ip6_null_entry, | 173 | .leaf = &ip6_null_entry, |
175 | .fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO, | 174 | .fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO, |
@@ -187,6 +186,12 @@ static void fib6_link_table(struct fib6_table *tb) | |||
187 | { | 186 | { |
188 | unsigned int h; | 187 | unsigned int h; |
189 | 188 | ||
189 | /* | ||
190 | * Initialize table lock at a single place to give lockdep a key, | ||
191 | * tables aren't visible prior to being linked to the list. | ||
192 | */ | ||
193 | rwlock_init(&tb->tb6_lock); | ||
194 | |||
190 | h = tb->tb6_id & (FIB_TABLE_HASHSZ - 1); | 195 | h = tb->tb6_id & (FIB_TABLE_HASHSZ - 1); |
191 | 196 | ||
192 | /* | 197 | /* |
@@ -199,7 +204,6 @@ static void fib6_link_table(struct fib6_table *tb) | |||
199 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | 204 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES |
200 | static struct fib6_table fib6_local_tbl = { | 205 | static struct fib6_table fib6_local_tbl = { |
201 | .tb6_id = RT6_TABLE_LOCAL, | 206 | .tb6_id = RT6_TABLE_LOCAL, |
202 | .tb6_lock = RW_LOCK_UNLOCKED, | ||
203 | .tb6_root = { | 207 | .tb6_root = { |
204 | .leaf = &ip6_null_entry, | 208 | .leaf = &ip6_null_entry, |
205 | .fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO, | 209 | .fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO, |
@@ -213,7 +217,6 @@ static struct fib6_table *fib6_alloc_table(u32 id) | |||
213 | table = kzalloc(sizeof(*table), GFP_ATOMIC); | 217 | table = kzalloc(sizeof(*table), GFP_ATOMIC); |
214 | if (table != NULL) { | 218 | if (table != NULL) { |
215 | table->tb6_id = id; | 219 | table->tb6_id = id; |
216 | table->tb6_lock = RW_LOCK_UNLOCKED; | ||
217 | table->tb6_root.leaf = &ip6_null_entry; | 220 | table->tb6_root.leaf = &ip6_null_entry; |
218 | table->tb6_root.fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO; | 221 | table->tb6_root.fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO; |
219 | } | 222 | } |