summaryrefslogtreecommitdiff
path: root/net/tipc/net.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2011-02-25 19:11:25 -0500
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-03-13 16:35:17 -0400
commit34e46258cb9f53b41e8ffd2e9acd58e0cf64b158 (patch)
tree1cf7f8d94a825678769b186849a6f41fa6765cf9 /net/tipc/net.c
parent672d99e19a12b703c9e2d71ead8fb8b8a85a3886 (diff)
tipc: manually inline net_start/stop, make assoc. vars static
Relocates network-related variables into the subsystem files where they are now primarily used (following the recent rework of TIPC's node table), and converts globals into locals where possible. Changes the initialization of tipc_num_links from run-time to compile-time, and eliminates the net_start routine that becomes empty as a result. Also eliminates the corresponding net_stop routine by moving its (trivial) content into the one location that called the routine. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/net.c')
-rw-r--r--net/tipc/net.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/net/tipc/net.c b/net/tipc/net.c
index cce8d086f173..8fbc7e6ae3df 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -109,22 +109,6 @@
*/
DEFINE_RWLOCK(tipc_net_lock);
-atomic_t tipc_num_links;
-
-static int net_start(void)
-{
- atomic_set(&tipc_num_links, 0);
-
- return 0;
-}
-
-static void net_stop(void)
-{
- struct tipc_node *node, *t_node;
-
- list_for_each_entry_safe(node, t_node, &tipc_node_list, list)
- tipc_node_delete(node);
-}
static void net_route_named_msg(struct sk_buff *buf)
{
@@ -214,9 +198,6 @@ int tipc_net_start(u32 addr)
tipc_named_reinit();
tipc_port_reinit();
- res = net_start();
- if (res)
- return res;
res = tipc_bclink_init();
if (res)
return res;
@@ -232,14 +213,16 @@ int tipc_net_start(u32 addr)
void tipc_net_stop(void)
{
+ struct tipc_node *node, *t_node;
+
if (tipc_mode != TIPC_NET_MODE)
return;
write_lock_bh(&tipc_net_lock);
tipc_bearer_stop();
tipc_mode = TIPC_NODE_MODE;
tipc_bclink_stop();
- net_stop();
+ list_for_each_entry_safe(node, t_node, &tipc_node_list, list);
+ tipc_node_delete(node);
write_unlock_bh(&tipc_net_lock);
info("Left network mode\n");
}
-