diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-01-15 02:14:20 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:02:15 -0500 |
commit | 7f9b80529b8a2ad8b3273b15fb444a0e34b760a9 (patch) | |
tree | ba6e38934797952a472970ee97d2131a6a6f29bb /net/ipv4/fib_trie.c | |
parent | d717a9a62049a03e85c3c2dd3399416eeb34a8be (diff) |
[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.c | 16 |
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: | |||
1926 | return -1; | 1926 | return -1; |
1927 | } | 1927 | } |
1928 | 1928 | ||
1929 | /* Fix more generic FIB names for init later */ | 1929 | void __init fib_hash_init(void) |
1930 | { | ||
1931 | fn_alias_kmem = kmem_cache_create("ip_fib_alias", sizeof(struct fib_alias), | ||
1932 | 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); | ||
1933 | } | ||
1930 | 1934 | ||
1931 | struct fib_table *fib_hash_init(u32 id) | 1935 | |
1936 | /* Fix more generic FIB names for init later */ | ||
1937 | struct fib_table *fib_hash_table(u32 id) | ||
1932 | { | 1938 | { |
1933 | struct fib_table *tb; | 1939 | struct fib_table *tb; |
1934 | struct trie *t; | 1940 | struct trie *t; |
1935 | 1941 | ||
1936 | if (fn_alias_kmem == NULL) | ||
1937 | fn_alias_kmem = kmem_cache_create("ip_fib_alias", | ||
1938 | sizeof(struct fib_alias), | ||
1939 | 0, SLAB_HWCACHE_ALIGN, | ||
1940 | NULL); | ||
1941 | |||
1942 | tb = kmalloc(sizeof(struct fib_table) + sizeof(struct trie), | 1942 | tb = kmalloc(sizeof(struct fib_table) + sizeof(struct trie), |
1943 | GFP_KERNEL); | 1943 | GFP_KERNEL); |
1944 | if (tb == NULL) | 1944 | if (tb == NULL) |