]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/fib_hash.c
[IPV4]: fib hash|trie initialization
[net-next-2.6.git] / net / ipv4 / fib_hash.c
index 258214f57fba0c61ef5f1275bf8ebdbfdb5596b8..499522f3b30552db9928ea337f90e7d46afa23ea 100644 (file)
@@ -747,21 +747,19 @@ static int fn_hash_dump(struct fib_table *tb, struct sk_buff *skb, struct netlin
        return skb->len;
 }
 
-struct fib_table *fib_hash_init(u32 id)
+void __init fib_hash_init(void)
 {
-       struct fib_table *tb;
+       fn_hash_kmem = kmem_cache_create("ip_fib_hash", sizeof(struct fib_node),
+                                        0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
+
+       fn_alias_kmem = kmem_cache_create("ip_fib_alias", sizeof(struct fib_alias),
+                                         0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
+
+}
 
-       if (fn_hash_kmem == NULL)
-               fn_hash_kmem = kmem_cache_create("ip_fib_hash",
-                                                sizeof(struct fib_node),
-                                                0, SLAB_HWCACHE_ALIGN,
-                                                NULL);
-
-       if (fn_alias_kmem == NULL)
-               fn_alias_kmem = kmem_cache_create("ip_fib_alias",
-                                                 sizeof(struct fib_alias),
-                                                 0, SLAB_HWCACHE_ALIGN,
-                                                 NULL);
+struct fib_table *fib_hash_table(u32 id)
+{
+       struct fib_table *tb;
 
        tb = kmalloc(sizeof(struct fib_table) + sizeof(struct fn_hash),
                     GFP_KERNEL);