aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/tipc/core.c')
-rw-r--r--net/tipc/core.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/net/tipc/core.c b/net/tipc/core.c
index ddd2e0f67c07..ed536c05252a 100644
--- a/net/tipc/core.c
+++ b/net/tipc/core.c
@@ -77,9 +77,6 @@ static int __net_init tipc_init_net(struct net *net)
77 goto out_nametbl; 77 goto out_nametbl;
78 78
79 INIT_LIST_HEAD(&tn->dist_queue); 79 INIT_LIST_HEAD(&tn->dist_queue);
80 err = tipc_topsrv_start(net);
81 if (err)
82 goto out_subscr;
83 80
84 err = tipc_bcast_init(net); 81 err = tipc_bcast_init(net);
85 if (err) 82 if (err)
@@ -88,8 +85,6 @@ static int __net_init tipc_init_net(struct net *net)
88 return 0; 85 return 0;
89 86
90out_bclink: 87out_bclink:
91 tipc_bcast_stop(net);
92out_subscr:
93 tipc_nametbl_stop(net); 88 tipc_nametbl_stop(net);
94out_nametbl: 89out_nametbl:
95 tipc_sk_rht_destroy(net); 90 tipc_sk_rht_destroy(net);
@@ -99,7 +94,6 @@ out_sk_rht:
99 94
100static void __net_exit tipc_exit_net(struct net *net) 95static void __net_exit tipc_exit_net(struct net *net)
101{ 96{
102 tipc_topsrv_stop(net);
103 tipc_net_stop(net); 97 tipc_net_stop(net);
104 tipc_bcast_stop(net); 98 tipc_bcast_stop(net);
105 tipc_nametbl_stop(net); 99 tipc_nametbl_stop(net);
@@ -113,6 +107,11 @@ static struct pernet_operations tipc_net_ops = {
113 .size = sizeof(struct tipc_net), 107 .size = sizeof(struct tipc_net),
114}; 108};
115 109
110static struct pernet_operations tipc_topsrv_net_ops = {
111 .init = tipc_topsrv_init_net,
112 .exit = tipc_topsrv_exit_net,
113};
114
116static int __init tipc_init(void) 115static int __init tipc_init(void)
117{ 116{
118 int err; 117 int err;
@@ -143,6 +142,10 @@ static int __init tipc_init(void)
143 if (err) 142 if (err)
144 goto out_socket; 143 goto out_socket;
145 144
145 err = register_pernet_subsys(&tipc_topsrv_net_ops);
146 if (err)
147 goto out_pernet_topsrv;
148
146 err = tipc_bearer_setup(); 149 err = tipc_bearer_setup();
147 if (err) 150 if (err)
148 goto out_bearer; 151 goto out_bearer;
@@ -150,6 +153,8 @@ static int __init tipc_init(void)
150 pr_info("Started in single node mode\n"); 153 pr_info("Started in single node mode\n");
151 return 0; 154 return 0;
152out_bearer: 155out_bearer:
156 unregister_pernet_subsys(&tipc_topsrv_net_ops);
157out_pernet_topsrv:
153 tipc_socket_stop(); 158 tipc_socket_stop();
154out_socket: 159out_socket:
155 unregister_pernet_subsys(&tipc_net_ops); 160 unregister_pernet_subsys(&tipc_net_ops);
@@ -167,6 +172,7 @@ out_netlink:
167static void __exit tipc_exit(void) 172static void __exit tipc_exit(void)
168{ 173{
169 tipc_bearer_cleanup(); 174 tipc_bearer_cleanup();
175 unregister_pernet_subsys(&tipc_topsrv_net_ops);
170 tipc_socket_stop(); 176 tipc_socket_stop();
171 unregister_pernet_subsys(&tipc_net_ops); 177 unregister_pernet_subsys(&tipc_net_ops);
172 tipc_netlink_stop(); 178 tipc_netlink_stop();