diff options
Diffstat (limited to 'net/tipc/net.c')
-rw-r--r-- | net/tipc/net.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/net/tipc/net.c b/net/tipc/net.c index dd78d869829f..f6303d79f7f5 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c | |||
@@ -108,26 +108,28 @@ | |||
108 | */ | 108 | */ |
109 | 109 | ||
110 | DEFINE_RWLOCK(tipc_net_lock); | 110 | DEFINE_RWLOCK(tipc_net_lock); |
111 | struct network tipc_net; | 111 | struct tipc_node **tipc_nodes; |
112 | u32 tipc_highest_node; | ||
113 | atomic_t tipc_num_links; | ||
112 | 114 | ||
113 | static int net_start(void) | 115 | static int net_start(void) |
114 | { | 116 | { |
115 | tipc_net.nodes = kcalloc(tipc_max_nodes + 1, | 117 | tipc_nodes = kcalloc(tipc_max_nodes + 1, |
116 | sizeof(*tipc_net.nodes), GFP_ATOMIC); | 118 | sizeof(*tipc_nodes), GFP_ATOMIC); |
117 | tipc_net.highest_node = 0; | 119 | tipc_highest_node = 0; |
118 | atomic_set(&tipc_net.links, 0); | 120 | atomic_set(&tipc_num_links, 0); |
119 | 121 | ||
120 | return tipc_net.nodes ? 0 : -ENOMEM; | 122 | return tipc_nodes ? 0 : -ENOMEM; |
121 | } | 123 | } |
122 | 124 | ||
123 | static void net_stop(void) | 125 | static void net_stop(void) |
124 | { | 126 | { |
125 | u32 n_num; | 127 | u32 n_num; |
126 | 128 | ||
127 | for (n_num = 1; n_num <= tipc_net.highest_node; n_num++) | 129 | for (n_num = 1; n_num <= tipc_highest_node; n_num++) |
128 | tipc_node_delete(tipc_net.nodes[n_num]); | 130 | tipc_node_delete(tipc_nodes[n_num]); |
129 | kfree(tipc_net.nodes); | 131 | kfree(tipc_nodes); |
130 | tipc_net.nodes = NULL; | 132 | tipc_nodes = NULL; |
131 | } | 133 | } |
132 | 134 | ||
133 | static void net_route_named_msg(struct sk_buff *buf) | 135 | static void net_route_named_msg(struct sk_buff *buf) |