aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_frontend.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-01-15 02:14:20 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:02:15 -0500
commit7f9b80529b8a2ad8b3273b15fb444a0e34b760a9 (patch)
treeba6e38934797952a472970ee97d2131a6a6f29bb /net/ipv4/fib_frontend.c
parentd717a9a62049a03e85c3c2dd3399416eeb34a8be (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_frontend.c')
-rw-r--r--net/ipv4/fib_frontend.c9
1 files changed, 6 insertions, 3 deletions
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)
53{ 53{
54 struct fib_table *local_table, *main_table; 54 struct fib_table *local_table, *main_table;
55 55
56 local_table = fib_hash_init(RT_TABLE_LOCAL); 56 local_table = fib_hash_table(RT_TABLE_LOCAL);
57 if (local_table == NULL) 57 if (local_table == NULL)
58 return -ENOMEM; 58 return -ENOMEM;
59 59
60 main_table = fib_hash_init(RT_TABLE_MAIN); 60 main_table = fib_hash_table(RT_TABLE_MAIN);
61 if (main_table == NULL) 61 if (main_table == NULL)
62 goto fail; 62 goto fail;
63 63
@@ -83,7 +83,8 @@ struct fib_table *fib_new_table(struct net *net, u32 id)
83 tb = fib_get_table(net, id); 83 tb = fib_get_table(net, id);
84 if (tb) 84 if (tb)
85 return tb; 85 return tb;
86 tb = fib_hash_init(id); 86
87 tb = fib_hash_table(id);
87 if (!tb) 88 if (!tb)
88 return NULL; 89 return NULL;
89 h = id & (FIB_TABLE_HASHSZ - 1); 90 h = id & (FIB_TABLE_HASHSZ - 1);
@@ -1042,6 +1043,8 @@ void __init ip_fib_init(void)
1042 register_pernet_subsys(&fib_net_ops); 1043 register_pernet_subsys(&fib_net_ops);
1043 register_netdevice_notifier(&fib_netdev_notifier); 1044 register_netdevice_notifier(&fib_netdev_notifier);
1044 register_inetaddr_notifier(&fib_inetaddr_notifier); 1045 register_inetaddr_notifier(&fib_inetaddr_notifier);
1046
1047 fib_hash_init();
1045} 1048}
1046 1049
1047EXPORT_SYMBOL(inet_addr_type); 1050EXPORT_SYMBOL(inet_addr_type);