tipc: Eliminate support for tipc_mode global variable

Removes all references to the global variable that records whether
TIPC is running in "single node" mode or "network" mode, since this
information can be easily deduced from the global variable that
records TIPC's network address. (i.e. a non-zero network address
means that TIPC is running in network mode.)

The changes made update most existing mode-based checks to use the
network address global variable. A few checks that are no longer
needed are removed entirely, along with any associated code lying on
non-executable control paths.

Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
This commit is contained in:
Allan Stephens 2011-11-08 13:48:28 -05:00 committed by Paul Gortmaker
parent 077a26f029
commit b58343f9ea
6 changed files with 5 additions and 20 deletions

View file

@ -175,14 +175,10 @@ int tipc_net_start(u32 addr)
{
char addr_string[16];
if (tipc_mode != TIPC_NODE_MODE)
return -ENOPROTOOPT;
tipc_subscr_stop();
tipc_cfg_stop();
tipc_own_addr = addr;
tipc_mode = TIPC_NET_MODE;
tipc_named_reinit();
tipc_port_reinit();
@ -201,10 +197,9 @@ void tipc_net_stop(void)
{
struct tipc_node *node, *t_node;
if (tipc_mode != TIPC_NET_MODE)
if (!tipc_own_addr)
return;
write_lock_bh(&tipc_net_lock);
tipc_mode = TIPC_NODE_MODE;
tipc_bearer_stop();
tipc_bclink_stop();
list_for_each_entry_safe(node, t_node, &tipc_node_list, list)