From c80262829769419e19527f972672e8df0480235a Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Tue, 30 Nov 2010 12:00:54 +0000 Subject: tipc: Remove obsolete inclusions of header files Gets rid of #include statements that are no longer required as a result of the merging of obsolete native API header file content into other TIPC include files. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker Signed-off-by: David S. Miller --- net/tipc/net.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'net/tipc/net.c') diff --git a/net/tipc/net.c b/net/tipc/net.c index 1a621cfd6604..c2b4b86c2e6a 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c @@ -35,18 +35,13 @@ */ #include "core.h" -#include "bearer.h" #include "net.h" #include "zone.h" -#include "addr.h" #include "name_table.h" #include "name_distr.h" #include "subscr.h" #include "link.h" -#include "msg.h" #include "port.h" -#include "bcast.h" -#include "discover.h" #include "config.h" /* -- cgit v1.2.3 From 51f98a8d70583b18cb08b19353aeed5efb0244af Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Fri, 31 Dec 2010 18:59:16 +0000 Subject: tipc: Remove prototype code for supporting multiple zones Eliminates routines, data structures, and files that were intended to allows TIPC to support a network containing multiple zones. Currently, TIPC supports only networks consisting of a single cluster within a single zone, so this code is unnecessary. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker Signed-off-by: David S. Miller --- net/tipc/net.c | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) (limited to 'net/tipc/net.c') diff --git a/net/tipc/net.c b/net/tipc/net.c index c2b4b86c2e6a..a25f8bb1e1d9 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c @@ -36,7 +36,6 @@ #include "core.h" #include "net.h" -#include "zone.h" #include "name_table.h" #include "name_distr.h" #include "subscr.h" @@ -111,46 +110,56 @@ */ DEFINE_RWLOCK(tipc_net_lock); -static struct _zone *tipc_zones[256] = { NULL, }; -struct network tipc_net = { tipc_zones }; +struct network tipc_net; struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref) { - return tipc_zone_select_remote_node(tipc_net.zones[tipc_zone(addr)], addr, ref); + struct cluster *c_ptr; + + c_ptr = tipc_net.clusters[1]; + if (!c_ptr) + return NULL; + return tipc_cltr_select_node(c_ptr, ref); } u32 tipc_net_select_router(u32 addr, u32 ref) { - return tipc_zone_select_router(tipc_net.zones[tipc_zone(addr)], addr, ref); + struct cluster *c_ptr; + + c_ptr = tipc_net.clusters[1]; + if (!c_ptr) + return 0; + return tipc_cltr_select_router(c_ptr, ref); } void tipc_net_remove_as_router(u32 router) { - u32 z_num; + u32 c_num; - for (z_num = 1; z_num <= tipc_max_zones; z_num++) { - if (!tipc_net.zones[z_num]) + for (c_num = 1; c_num <= tipc_max_clusters; c_num++) { + if (!tipc_net.clusters[c_num]) continue; - tipc_zone_remove_as_router(tipc_net.zones[z_num], router); + tipc_cltr_remove_as_router(tipc_net.clusters[c_num], router); } } void tipc_net_send_external_routes(u32 dest) { - u32 z_num; + u32 c_num; - for (z_num = 1; z_num <= tipc_max_zones; z_num++) { - if (tipc_net.zones[z_num]) - tipc_zone_send_external_routes(tipc_net.zones[z_num], dest); + for (c_num = 1; c_num <= tipc_max_clusters; c_num++) { + if (tipc_net.clusters[c_num]) + tipc_cltr_send_ext_routes(tipc_net.clusters[c_num], + dest); } } static void net_stop(void) { - u32 z_num; + u32 c_num; - for (z_num = 1; z_num <= tipc_max_zones; z_num++) - tipc_zone_delete(tipc_net.zones[z_num]); + for (c_num = 1; c_num <= tipc_max_clusters; c_num++) + tipc_cltr_delete(tipc_net.clusters[c_num]); } static void net_route_named_msg(struct sk_buff *buf) -- cgit v1.2.3 From 51a8e4dee7653698ba4c6e7de71053665f075273 Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Fri, 31 Dec 2010 18:59:18 +0000 Subject: tipc: Remove prototype code for supporting inter-cluster routing Eliminates routines and data structures that were intended to allow TIPC to route messages to other clusters. Currently, TIPC supports only networks consisting of a single cluster within a single zone, so this code is unnecessary. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker Signed-off-by: David S. Miller --- net/tipc/net.c | 45 --------------------------------------------- 1 file changed, 45 deletions(-) (limited to 'net/tipc/net.c') diff --git a/net/tipc/net.c b/net/tipc/net.c index a25f8bb1e1d9..3967f1f6d97f 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c @@ -112,48 +112,6 @@ DEFINE_RWLOCK(tipc_net_lock); struct network tipc_net; -struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref) -{ - struct cluster *c_ptr; - - c_ptr = tipc_net.clusters[1]; - if (!c_ptr) - return NULL; - return tipc_cltr_select_node(c_ptr, ref); -} - -u32 tipc_net_select_router(u32 addr, u32 ref) -{ - struct cluster *c_ptr; - - c_ptr = tipc_net.clusters[1]; - if (!c_ptr) - return 0; - return tipc_cltr_select_router(c_ptr, ref); -} - -void tipc_net_remove_as_router(u32 router) -{ - u32 c_num; - - for (c_num = 1; c_num <= tipc_max_clusters; c_num++) { - if (!tipc_net.clusters[c_num]) - continue; - tipc_cltr_remove_as_router(tipc_net.clusters[c_num], router); - } -} - -void tipc_net_send_external_routes(u32 dest) -{ - u32 c_num; - - for (c_num = 1; c_num <= tipc_max_clusters; c_num++) { - if (tipc_net.clusters[c_num]) - tipc_cltr_send_ext_routes(tipc_net.clusters[c_num], - dest); - } -} - static void net_stop(void) { u32 c_num; @@ -225,9 +183,6 @@ void tipc_net_route_msg(struct sk_buff *buf) return; } switch (msg_user(msg)) { - case ROUTE_DISTRIBUTOR: - tipc_cltr_recv_routing_table(buf); - break; case NAME_DISTRIBUTOR: tipc_named_recv(buf); break; -- cgit v1.2.3 From 8f92df6ad49da958d97e171762d0a97a3dc738f1 Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Fri, 31 Dec 2010 18:59:19 +0000 Subject: tipc: Remove prototype code for supporting multiple clusters Eliminates routines, data structures, and files that were intended to allow TIPC to support a network containing multiple clusters. Currently, TIPC supports only networks consisting of a single cluster within a single zone, so this code is unnecessary. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker Signed-off-by: David S. Miller --- net/tipc/net.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'net/tipc/net.c') diff --git a/net/tipc/net.c b/net/tipc/net.c index 3967f1f6d97f..3baf55ee0985 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c @@ -112,12 +112,23 @@ DEFINE_RWLOCK(tipc_net_lock); struct network tipc_net; +static int net_start(void) +{ + tipc_net.nodes = kcalloc(tipc_max_nodes + 1, + sizeof(*tipc_net.nodes), GFP_ATOMIC); + tipc_net.highest_node = 0; + + return tipc_net.nodes ? 0 : -ENOMEM; +} + static void net_stop(void) { - u32 c_num; + u32 n_num; - for (c_num = 1; c_num <= tipc_max_clusters; c_num++) - tipc_cltr_delete(tipc_net.clusters[c_num]); + for (n_num = 1; n_num <= tipc_net.highest_node; n_num++) + tipc_node_delete(tipc_net.nodes[n_num]); + kfree(tipc_net.nodes); + tipc_net.nodes = NULL; } static void net_route_named_msg(struct sk_buff *buf) @@ -218,10 +229,12 @@ int tipc_net_start(u32 addr) tipc_named_reinit(); tipc_port_reinit(); - if ((res = tipc_cltr_init()) || - (res = tipc_bclink_init())) { + res = net_start(); + if (res) + return res; + res = tipc_bclink_init(); + if (res) return res; - } tipc_k_signal((Handler)tipc_subscr_start, 0); tipc_k_signal((Handler)tipc_cfg_init, 0); -- cgit v1.2.3 From b29f14284989b3d0b3a5ce268b5b1fc4df9c5795 Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Fri, 31 Dec 2010 18:59:25 +0000 Subject: tipc: remove calls to dbg() and msg_dbg() Eliminates obsolete calls to two of TIPC's main debugging macros, as well as a pair of associated debugging routines that are no longer required. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker Signed-off-by: David S. Miller --- net/tipc/net.c | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'net/tipc/net.c') diff --git a/net/tipc/net.c b/net/tipc/net.c index 3baf55ee0985..6290becd35be 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c @@ -138,22 +138,18 @@ static void net_route_named_msg(struct sk_buff *buf) u32 dport; if (!msg_named(msg)) { - msg_dbg(msg, "tipc_net->drop_nam:"); buf_discard(buf); return; } dnode = addr_domain(msg_lookup_scope(msg)); dport = tipc_nametbl_translate(msg_nametype(msg), msg_nameinst(msg), &dnode); - dbg("tipc_net->lookup<%u,%u>-><%u,%x>\n", - msg_nametype(msg), msg_nameinst(msg), dport, dnode); if (dport) { msg_set_destnode(msg, dnode); msg_set_destport(msg, dport); tipc_net_route_msg(buf); return; } - msg_dbg(msg, "tipc_net->rej:NO NAME: "); tipc_reject_msg(buf, TIPC_ERR_NO_NAME); } @@ -169,18 +165,14 @@ void tipc_net_route_msg(struct sk_buff *buf) msg_incr_reroute_cnt(msg); if (msg_reroute_cnt(msg) > 6) { if (msg_errcode(msg)) { - msg_dbg(msg, "NET>DISC>:"); buf_discard(buf); } else { - msg_dbg(msg, "NET>REJ>:"); tipc_reject_msg(buf, msg_destport(msg) ? TIPC_ERR_NO_PORT : TIPC_ERR_NO_NAME); } return; } - msg_dbg(msg, "tipc_net->rout: "); - /* Handle message for this node */ dnode = msg_short(msg) ? tipc_own_addr : msg_destnode(msg); if (tipc_in_scope(dnode, tipc_own_addr)) { @@ -201,14 +193,12 @@ void tipc_net_route_msg(struct sk_buff *buf) tipc_port_recv_proto_msg(buf); break; default: - msg_dbg(msg,"DROP/NET/SEND>: "); skb_trim(buf, msg_size(msg)); tipc_link_send(buf, dnode, msg_link_selector(msg)); } -- cgit v1.2.3 From 886ef52a8ce6930a9d0c58267d5b5038ac3e8d30 Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Fri, 31 Dec 2010 18:59:29 +0000 Subject: tipc: remove redundant #includes Eliminates a number of #include statements that no longer serve any useful purpose. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker Signed-off-by: David S. Miller --- net/tipc/net.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'net/tipc/net.c') diff --git a/net/tipc/net.c b/net/tipc/net.c index 6290becd35be..9bacfd00b91e 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c @@ -36,10 +36,8 @@ #include "core.h" #include "net.h" -#include "name_table.h" #include "name_distr.h" #include "subscr.h" -#include "link.h" #include "port.h" #include "config.h" -- cgit v1.2.3