aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/core.c
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2015-01-09 02:27:05 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-12 16:24:32 -0500
commitf2f9800d4955a96d92896841d8ba9b04201deaa1 (patch)
tree3b817800cfd8fcb2de6d5a3d7eb4fff972fba681 /net/tipc/core.c
parentc93d3baa24095887005647984cff5de8c63d3611 (diff)
tipc: make tipc node table aware of net namespace
Global variables associated with node table are below: - node table list (node_htable) - node hash table list (tipc_node_list) - node table lock (node_list_lock) - node number counter (tipc_num_nodes) - node link number counter (tipc_num_links) To make node table support namespace, above global variables must be moved to tipc_net structure in order to keep secret for different namespaces. As a consequence, these variables are allocated and initialized when namespace is created, and deallocated when namespace is destroyed. After the change, functions associated with these variables have to utilize a namespace pointer to access them. So adding namespace pointer as a parameter of these functions is the major change made in the commit. Signed-off-by: Ying Xue <ying.xue@windriver.com> Tested-by: Tero Aho <Tero.Aho@coriant.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/core.c')
-rw-r--r--net/tipc/core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/tipc/core.c b/net/tipc/core.c
index a2302480d8cf..7b8443938caf 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -57,12 +57,15 @@ static int __net_init tipc_init_net(struct net *net)
57 struct tipc_net *tn = net_generic(net, tipc_net_id); 57 struct tipc_net *tn = net_generic(net, tipc_net_id);
58 58
59 tn->net_id = 4711; 59 tn->net_id = 4711;
60 INIT_LIST_HEAD(&tn->node_list);
61 spin_lock_init(&tn->node_list_lock);
60 62
61 return 0; 63 return 0;
62} 64}
63 65
64static void __net_exit tipc_exit_net(struct net *net) 66static void __net_exit tipc_exit_net(struct net *net)
65{ 67{
68 tipc_net_stop(net);
66} 69}
67 70
68static struct pernet_operations tipc_net_ops = { 71static struct pernet_operations tipc_net_ops = {
@@ -144,7 +147,6 @@ out_pernet:
144static void __exit tipc_exit(void) 147static void __exit tipc_exit(void)
145{ 148{
146 unregister_pernet_subsys(&tipc_net_ops); 149 unregister_pernet_subsys(&tipc_net_ops);
147 tipc_net_stop();
148 tipc_bearer_cleanup(); 150 tipc_bearer_cleanup();
149 tipc_netlink_stop(); 151 tipc_netlink_stop();
150 tipc_subscr_stop(); 152 tipc_subscr_stop();