summaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_trie.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-01-14 23:14:20 -0800
committerDavid S. Miller <davem@davemloft.net>2008-01-28 15:02:15 -0800
commit7f9b80529b8a2ad8b3273b15fb444a0e34b760a9 (patch)
treeba6e38934797952a472970ee97d2131a6a6f29bb /net/ipv4/fib_trie.c
parentd717a9a62049a03e85c3c2dd3399416eeb34a8be (diff)
downloadlinux-stable-7f9b80529b8a2ad8b3273b15fb444a0e34b760a9.tar.gz
linux-stable-7f9b80529b8a2ad8b3273b15fb444a0e34b760a9.tar.bz2
linux-stable-7f9b80529b8a2ad8b3273b15fb444a0e34b760a9.zip
[IPV4]: fib hash|trie initialization
Initialization of the slab cache's should be done when IP is initialized to make sure of available memory, and that code can be marked __init. Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_trie.c')
-rw-r--r--net/ipv4/fib_trie.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index a15cb0d2e113..fbc80d15827b 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1926,19 +1926,19 @@ out:
return -1;
}
-/* Fix more generic FIB names for init later */
+void __init fib_hash_init(void)
+{
+ fn_alias_kmem = kmem_cache_create("ip_fib_alias", sizeof(struct fib_alias),
+ 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
+}
-struct fib_table *fib_hash_init(u32 id)
+
+/* Fix more generic FIB names for init later */
+struct fib_table *fib_hash_table(u32 id)
{
struct fib_table *tb;
struct trie *t;
- if (fn_alias_kmem == NULL)
- fn_alias_kmem = kmem_cache_create("ip_fib_alias",
- sizeof(struct fib_alias),
- 0, SLAB_HWCACHE_ALIGN,
- NULL);
-
tb = kmalloc(sizeof(struct fib_table) + sizeof(struct trie),
GFP_KERNEL);
if (tb == NULL)