From d265fef6ddf9042195aae551e1fde211c2a1588b Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Tue, 30 Nov 2010 12:00:53 +0000 Subject: tipc: Remove obsolete native API files and exports As part of the removal of TIPC's native API support it is no longer necessary for TIPC to export symbols for routines that can be called by kernel-based applications, nor for it to have header files that kernel-based applications can include to access the declarations for those routines. This commit eliminates the exporting of symbols by TIPC and migrates the contents of each obsolete native API include file into its corresponding non-native API equivalent. The code which was migrated in this commit was migrated intact, in that there are no technical changes combined with the relocation. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker Signed-off-by: David S. Miller --- net/tipc/bcast.c | 1 + 1 file changed, 1 insertion(+) (limited to 'net/tipc/bcast.c') diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 22a60fc9839..7d449f03c38 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -47,6 +47,7 @@ #include "name_distr.h" #include "bearer.h" #include "name_table.h" +#include "port.h" #include "bcast.h" #define MAX_PKT_DEFAULT_MCAST 1500 /* bcast link max packet size (fixed) */ -- cgit v1.2.3 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/bcast.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'net/tipc/bcast.c') diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 7d449f03c38..6d828d9eda4 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -36,18 +36,9 @@ */ #include "core.h" -#include "msg.h" -#include "dbg.h" #include "link.h" -#include "net.h" -#include "node.h" #include "port.h" -#include "addr.h" -#include "node_subscr.h" #include "name_distr.h" -#include "bearer.h" -#include "name_table.h" -#include "port.h" #include "bcast.h" #define MAX_PKT_DEFAULT_MCAST 1500 /* bcast link max packet size (fixed) */ -- 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/bcast.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'net/tipc/bcast.c') diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 6d828d9eda4..110829eab96 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -111,6 +111,9 @@ static struct bclink *bclink = NULL; static struct link *bcl = NULL; static DEFINE_SPINLOCK(bc_lock); +/* broadcast-capable node map */ +struct tipc_node_map tipc_bcast_nmap; + const char tipc_bclink_name[] = "broadcast-link"; static void tipc_nmap_diff(struct tipc_node_map *nm_a, @@ -566,8 +569,8 @@ static int tipc_bcbearer_send(struct sk_buff *buf, if (likely(!msg_non_seq(buf_msg(buf)))) { struct tipc_msg *msg; - assert(tipc_cltr_bcast_nodes.count != 0); - bcbuf_set_acks(buf, tipc_cltr_bcast_nodes.count); + assert(tipc_bcast_nmap.count != 0); + bcbuf_set_acks(buf, tipc_bcast_nmap.count); msg = buf_msg(buf); msg_set_non_seq(msg, 1); msg_set_mc_netid(msg, tipc_net_id); @@ -576,7 +579,7 @@ static int tipc_bcbearer_send(struct sk_buff *buf, /* Send buffer over bearers until all targets reached */ - bcbearer->remains = tipc_cltr_bcast_nodes; + bcbearer->remains = tipc_bcast_nmap; for (bp_index = 0; bp_index < MAX_BEARERS; bp_index++) { struct bearer *p = bcbearer->bpairs[bp_index].primary; -- 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/bcast.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'net/tipc/bcast.c') diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 110829eab96..cb817d503c1 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -436,8 +436,6 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf) u32 seqno; struct sk_buff *deferred; - msg_dbg(msg, "bclink.supported || (msg_mc_netid(msg) != tipc_net_id))) { buf_discard(buf); @@ -445,7 +443,6 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf) } if (unlikely(msg_user(msg) == BCAST_PROTOCOL)) { - msg_dbg(msg, " Date: Fri, 31 Dec 2010 18:59:27 +0000 Subject: tipc: Prune down link-specific debugging code Eliminates most link-specific debugging code in TIPC, which is now largely unnecessary. All calls to the link-specific debugging macros have been removed, as are the macros themselves; in addition, the optional allocation of print buffers to hold debugging information for each link endpoint has been removed. The ability for TIPC to print out helpful diagnostic information when link retransmit failures occur has been retained for the time being, as an aid in tracking down the cause of such failures. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker Signed-off-by: David S. Miller --- net/tipc/bcast.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'net/tipc/bcast.c') diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index cb817d503c1..22a10fadc8c 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -45,8 +45,6 @@ #define BCLINK_WIN_DEFAULT 20 /* bcast link window size (default) */ -#define BCLINK_LOG_BUF_SIZE 0 - /* * Loss rate for incoming broadcast frames; used to test retransmission code. * Set to N to cause every N'th frame to be discarded; 0 => don't discard any. @@ -774,7 +772,6 @@ int tipc_bclink_init(void) bcbearer = kzalloc(sizeof(*bcbearer), GFP_ATOMIC); bclink = kzalloc(sizeof(*bclink), GFP_ATOMIC); if (!bcbearer || !bclink) { - nomem: warn("Multicast link creation failed, no memory\n"); kfree(bcbearer); bcbearer = NULL; @@ -799,14 +796,6 @@ int tipc_bclink_init(void) bcl->state = WORKING_WORKING; strlcpy(bcl->name, tipc_bclink_name, TIPC_MAX_LINK_NAME); - if (BCLINK_LOG_BUF_SIZE) { - char *pb = kmalloc(BCLINK_LOG_BUF_SIZE, GFP_ATOMIC); - - if (!pb) - goto nomem; - tipc_printbuf_init(&bcl->print_buf, pb, BCLINK_LOG_BUF_SIZE); - } - return 0; } @@ -815,8 +804,6 @@ void tipc_bclink_stop(void) spin_lock_bh(&bc_lock); if (bcbearer) { tipc_link_stop(bcl); - if (BCLINK_LOG_BUF_SIZE) - kfree(bcl->print_buf.buf); bcl = NULL; kfree(bclink); bclink = NULL; -- 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/bcast.c | 1 - 1 file changed, 1 deletion(-) (limited to 'net/tipc/bcast.c') diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 22a10fadc8c..c0f3b096e7f 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -38,7 +38,6 @@ #include "core.h" #include "link.h" #include "port.h" -#include "name_distr.h" #include "bcast.h" #define MAX_PKT_DEFAULT_MCAST 1500 /* bcast link max packet size (fixed) */ -- cgit v1.2.3 From 0e65967e33be61e5f67727edd4ea829b47676fc0 Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Fri, 31 Dec 2010 18:59:32 +0000 Subject: tipc: cleanup various cosmetic whitespace issues Cleans up TIPC's source code to eliminate deviations from generally accepted coding conventions relating to leading/trailing white space and white space around commas, braces, cases, and sizeof. These changes are purely cosmetic and do not alter the operation of TIPC in any way. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker Signed-off-by: David S. Miller --- net/tipc/bcast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/tipc/bcast.c') diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index c0f3b096e7f..9de32564984 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -428,7 +428,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf) static int rx_count = 0; #endif struct tipc_msg *msg = buf_msg(buf); - struct tipc_node* node = tipc_node_find(msg_prevnode(msg)); + struct tipc_node *node = tipc_node_find(msg_prevnode(msg)); u32 next_in; u32 seqno; struct sk_buff *deferred; -- cgit v1.2.3 From e3ec9c7d5eea9adf2c604c623c987360cc700b88 Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Fri, 31 Dec 2010 18:59:34 +0000 Subject: tipc: remove zeroing assignments to static global variables Cleans up TIPC's source code to eliminate the needless initialization of static variables to zero. These changes are purely cosmetic and do not alter the operation of TIPC in any way. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker Signed-off-by: David S. Miller --- net/tipc/bcast.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'net/tipc/bcast.c') diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 9de32564984..99a1469e300 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -103,9 +103,9 @@ struct bclink { }; -static struct bcbearer *bcbearer = NULL; -static struct bclink *bclink = NULL; -static struct link *bcl = NULL; +static struct bcbearer *bcbearer; +static struct bclink *bclink; +static struct link *bcl; static DEFINE_SPINLOCK(bc_lock); /* broadcast-capable node map */ @@ -425,7 +425,7 @@ int tipc_bclink_send_msg(struct sk_buff *buf) void tipc_bclink_recv_pkt(struct sk_buff *buf) { #if (TIPC_BCAST_LOSS_RATE) - static int rx_count = 0; + static int rx_count; #endif struct tipc_msg *msg = buf_msg(buf); struct tipc_node *node = tipc_node_find(msg_prevnode(msg)); -- cgit v1.2.3 From a016892cd6eb8d3dd9769021b088917ac7371abd Mon Sep 17 00:00:00 2001 From: Allan Stephens Date: Fri, 31 Dec 2010 18:59:35 +0000 Subject: tipc: remove extraneous braces from single statements Cleans up TIPC's source code to eliminate the presence of unnecessary use of {} around single statements. These changes are purely cosmetic and do not alter the operation of TIPC in any way. Signed-off-by: Allan Stephens Signed-off-by: Paul Gortmaker Signed-off-by: David S. Miller --- net/tipc/bcast.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'net/tipc/bcast.c') diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index 99a1469e300..70ab5ef4876 100644 --- a/net/tipc/bcast.c +++ b/net/tipc/bcast.c @@ -196,9 +196,8 @@ static void bclink_retransmit_pkt(u32 after, u32 to) struct sk_buff *buf; buf = bcl->first_out; - while (buf && less_eq(buf_seqno(buf), after)) { + while (buf && less_eq(buf_seqno(buf), after)) buf = buf->next; - } tipc_link_retransmit(bcl, buf, mod(to - after)); } @@ -224,9 +223,8 @@ void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked) /* Skip over packets that node has previously acknowledged */ crs = bcl->first_out; - while (crs && less_eq(buf_seqno(crs), n_ptr->bclink.acked)) { + while (crs && less_eq(buf_seqno(crs), n_ptr->bclink.acked)) crs = crs->next; - } /* Update packets that node is now acknowledging */ -- cgit v1.2.3