diff options
author | Denis V. Lunev <den@openvz.org> | 2008-01-10 06:21:09 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:01:24 -0500 |
commit | 61a0265344786a548e8a0b26cb668e78a71f9602 (patch) | |
tree | cebfe266232678baba5b3d48f46b3e0f160bebdb /net/ipv4/fib_trie.c | |
parent | 5fd30ee7c48bf7f9cd16ab44c8a09fa4a57cc21d (diff) |
[NETNS]: Add namespace to API for routing /proc entries creation.
This adds netns parameter to fib_proc_init/exit and replaces __init
specifier with __net_init. After this, we will not yet have these proc
files show info from the specific namespace - this will be done when
these tables become namespaced.
Acked-by: Benjamin Thery <benjamin.thery@bull.net>
Acked-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
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 | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index a842204df7ba..4bbfaeedf210 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -2508,32 +2508,33 @@ static const struct file_operations fib_route_fops = { | |||
2508 | .release = seq_release_private, | 2508 | .release = seq_release_private, |
2509 | }; | 2509 | }; |
2510 | 2510 | ||
2511 | int __init fib_proc_init(void) | 2511 | int __net_init fib_proc_init(struct net *net) |
2512 | { | 2512 | { |
2513 | if (!proc_net_fops_create(&init_net, "fib_trie", S_IRUGO, &fib_trie_fops)) | 2513 | if (!proc_net_fops_create(net, "fib_trie", S_IRUGO, &fib_trie_fops)) |
2514 | goto out1; | 2514 | goto out1; |
2515 | 2515 | ||
2516 | if (!proc_net_fops_create(&init_net, "fib_triestat", S_IRUGO, &fib_triestat_fops)) | 2516 | if (!proc_net_fops_create(net, "fib_triestat", S_IRUGO, |
2517 | &fib_triestat_fops)) | ||
2517 | goto out2; | 2518 | goto out2; |
2518 | 2519 | ||
2519 | if (!proc_net_fops_create(&init_net, "route", S_IRUGO, &fib_route_fops)) | 2520 | if (!proc_net_fops_create(net, "route", S_IRUGO, &fib_route_fops)) |
2520 | goto out3; | 2521 | goto out3; |
2521 | 2522 | ||
2522 | return 0; | 2523 | return 0; |
2523 | 2524 | ||
2524 | out3: | 2525 | out3: |
2525 | proc_net_remove(&init_net, "fib_triestat"); | 2526 | proc_net_remove(net, "fib_triestat"); |
2526 | out2: | 2527 | out2: |
2527 | proc_net_remove(&init_net, "fib_trie"); | 2528 | proc_net_remove(net, "fib_trie"); |
2528 | out1: | 2529 | out1: |
2529 | return -ENOMEM; | 2530 | return -ENOMEM; |
2530 | } | 2531 | } |
2531 | 2532 | ||
2532 | void __init fib_proc_exit(void) | 2533 | void __net_exit fib_proc_exit(struct net *net) |
2533 | { | 2534 | { |
2534 | proc_net_remove(&init_net, "fib_trie"); | 2535 | proc_net_remove(net, "fib_trie"); |
2535 | proc_net_remove(&init_net, "fib_triestat"); | 2536 | proc_net_remove(net, "fib_triestat"); |
2536 | proc_net_remove(&init_net, "route"); | 2537 | proc_net_remove(net, "route"); |
2537 | } | 2538 | } |
2538 | 2539 | ||
2539 | #endif /* CONFIG_PROC_FS */ | 2540 | #endif /* CONFIG_PROC_FS */ |