From 7f9b80529b8a2ad8b3273b15fb444a0e34b760a9 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 14 Jan 2008 23:14:20 -0800 Subject: [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 Signed-off-by: David S. Miller --- net/ipv4/fib_frontend.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'net/ipv4/fib_frontend.c') diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 02b5ff73357f..8ddcd3f91a17 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -53,11 +53,11 @@ static int __net_init fib4_rules_init(struct net *net) { struct fib_table *local_table, *main_table; - local_table = fib_hash_init(RT_TABLE_LOCAL); + local_table = fib_hash_table(RT_TABLE_LOCAL); if (local_table == NULL) return -ENOMEM; - main_table = fib_hash_init(RT_TABLE_MAIN); + main_table = fib_hash_table(RT_TABLE_MAIN); if (main_table == NULL) goto fail; @@ -83,7 +83,8 @@ struct fib_table *fib_new_table(struct net *net, u32 id) tb = fib_get_table(net, id); if (tb) return tb; - tb = fib_hash_init(id); + + tb = fib_hash_table(id); if (!tb) return NULL; h = id & (FIB_TABLE_HASHSZ - 1); @@ -1042,6 +1043,8 @@ void __init ip_fib_init(void) register_pernet_subsys(&fib_net_ops); register_netdevice_notifier(&fib_netdev_notifier); register_inetaddr_notifier(&fib_inetaddr_notifier); + + fib_hash_init(); } EXPORT_SYMBOL(inet_addr_type); -- cgit v1.2.3