diff options
author | stephen hemminger <shemminger@vyatta.com> | 2010-10-13 09:20:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-16 14:13:24 -0400 |
commit | 31e3c3f6f1f9b154981a0e6620df700463db30ee (patch) | |
tree | 5ed74529c528cc9a09d6f8c9a5083aaf4849b62e /net/tipc/link.c | |
parent | 15419227f773b6c1b5fae44bde876078a9204caa (diff) |
tipc: cleanup function namespace
Do some cleanups of TIPC based on make namespacecheck
1. Don't export unused symbols
2. Eliminate dead code
3. Make functions and variables local
4. Rename buf_acquire to tipc_buf_acquire since it is used in several files
Compile tested only.
This make break out of tree kernel modules that depend on TIPC routines.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Acked-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r-- | net/tipc/link.c | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c index 4be78ecf4a67..b31992ccd5d3 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -112,6 +112,9 @@ static void link_state_event(struct link *l_ptr, u32 event); | |||
112 | static void link_reset_statistics(struct link *l_ptr); | 112 | static void link_reset_statistics(struct link *l_ptr); |
113 | static void link_print(struct link *l_ptr, struct print_buf *buf, | 113 | static void link_print(struct link *l_ptr, struct print_buf *buf, |
114 | const char *str); | 114 | const char *str); |
115 | static void link_start(struct link *l_ptr); | ||
116 | static int link_send_long_buf(struct link *l_ptr, struct sk_buff *buf); | ||
117 | |||
115 | 118 | ||
116 | /* | 119 | /* |
117 | * Debugging code used by link routines only | 120 | * Debugging code used by link routines only |
@@ -442,7 +445,7 @@ struct link *tipc_link_create(struct bearer *b_ptr, const u32 peer, | |||
442 | 445 | ||
443 | k_init_timer(&l_ptr->timer, (Handler)link_timeout, (unsigned long)l_ptr); | 446 | k_init_timer(&l_ptr->timer, (Handler)link_timeout, (unsigned long)l_ptr); |
444 | list_add_tail(&l_ptr->link_list, &b_ptr->links); | 447 | list_add_tail(&l_ptr->link_list, &b_ptr->links); |
445 | tipc_k_signal((Handler)tipc_link_start, (unsigned long)l_ptr); | 448 | tipc_k_signal((Handler)link_start, (unsigned long)l_ptr); |
446 | 449 | ||
447 | dbg("tipc_link_create(): tolerance = %u,cont intv = %u, abort_limit = %u\n", | 450 | dbg("tipc_link_create(): tolerance = %u,cont intv = %u, abort_limit = %u\n", |
448 | l_ptr->tolerance, l_ptr->continuity_interval, l_ptr->abort_limit); | 451 | l_ptr->tolerance, l_ptr->continuity_interval, l_ptr->abort_limit); |
@@ -482,9 +485,9 @@ void tipc_link_delete(struct link *l_ptr) | |||
482 | kfree(l_ptr); | 485 | kfree(l_ptr); |
483 | } | 486 | } |
484 | 487 | ||
485 | void tipc_link_start(struct link *l_ptr) | 488 | static void link_start(struct link *l_ptr) |
486 | { | 489 | { |
487 | dbg("tipc_link_start %x\n", l_ptr); | 490 | dbg("link_start %x\n", l_ptr); |
488 | link_state_event(l_ptr, STARTING_EVT); | 491 | link_state_event(l_ptr, STARTING_EVT); |
489 | } | 492 | } |
490 | 493 | ||
@@ -1000,7 +1003,7 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf) | |||
1000 | /* Fragmentation needed ? */ | 1003 | /* Fragmentation needed ? */ |
1001 | 1004 | ||
1002 | if (size > max_packet) | 1005 | if (size > max_packet) |
1003 | return tipc_link_send_long_buf(l_ptr, buf); | 1006 | return link_send_long_buf(l_ptr, buf); |
1004 | 1007 | ||
1005 | /* Packet can be queued or sent: */ | 1008 | /* Packet can be queued or sent: */ |
1006 | 1009 | ||
@@ -1036,7 +1039,7 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf) | |||
1036 | /* Try creating a new bundle */ | 1039 | /* Try creating a new bundle */ |
1037 | 1040 | ||
1038 | if (size <= max_packet * 2 / 3) { | 1041 | if (size <= max_packet * 2 / 3) { |
1039 | struct sk_buff *bundler = buf_acquire(max_packet); | 1042 | struct sk_buff *bundler = tipc_buf_acquire(max_packet); |
1040 | struct tipc_msg bundler_hdr; | 1043 | struct tipc_msg bundler_hdr; |
1041 | 1044 | ||
1042 | if (bundler) { | 1045 | if (bundler) { |
@@ -1312,7 +1315,7 @@ again: | |||
1312 | 1315 | ||
1313 | /* Prepare header of first fragment: */ | 1316 | /* Prepare header of first fragment: */ |
1314 | 1317 | ||
1315 | buf_chain = buf = buf_acquire(max_pkt); | 1318 | buf_chain = buf = tipc_buf_acquire(max_pkt); |
1316 | if (!buf) | 1319 | if (!buf) |
1317 | return -ENOMEM; | 1320 | return -ENOMEM; |
1318 | buf->next = NULL; | 1321 | buf->next = NULL; |
@@ -1369,7 +1372,7 @@ error: | |||
1369 | msg_set_size(&fragm_hdr, fragm_sz + INT_H_SIZE); | 1372 | msg_set_size(&fragm_hdr, fragm_sz + INT_H_SIZE); |
1370 | msg_set_fragm_no(&fragm_hdr, ++fragm_no); | 1373 | msg_set_fragm_no(&fragm_hdr, ++fragm_no); |
1371 | prev = buf; | 1374 | prev = buf; |
1372 | buf = buf_acquire(fragm_sz + INT_H_SIZE); | 1375 | buf = tipc_buf_acquire(fragm_sz + INT_H_SIZE); |
1373 | if (!buf) | 1376 | if (!buf) |
1374 | goto error; | 1377 | goto error; |
1375 | 1378 | ||
@@ -2145,7 +2148,7 @@ void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg, | |||
2145 | if (tipc_bearer_congested(l_ptr->b_ptr, l_ptr)) { | 2148 | if (tipc_bearer_congested(l_ptr->b_ptr, l_ptr)) { |
2146 | if (!l_ptr->proto_msg_queue) { | 2149 | if (!l_ptr->proto_msg_queue) { |
2147 | l_ptr->proto_msg_queue = | 2150 | l_ptr->proto_msg_queue = |
2148 | buf_acquire(sizeof(l_ptr->proto_msg)); | 2151 | tipc_buf_acquire(sizeof(l_ptr->proto_msg)); |
2149 | } | 2152 | } |
2150 | buf = l_ptr->proto_msg_queue; | 2153 | buf = l_ptr->proto_msg_queue; |
2151 | if (!buf) | 2154 | if (!buf) |
@@ -2159,7 +2162,7 @@ void tipc_link_send_proto_msg(struct link *l_ptr, u32 msg_typ, int probe_msg, | |||
2159 | 2162 | ||
2160 | msg_dbg(msg, ">>"); | 2163 | msg_dbg(msg, ">>"); |
2161 | 2164 | ||
2162 | buf = buf_acquire(msg_size); | 2165 | buf = tipc_buf_acquire(msg_size); |
2163 | if (!buf) | 2166 | if (!buf) |
2164 | return; | 2167 | return; |
2165 | 2168 | ||
@@ -2318,10 +2321,10 @@ exit: | |||
2318 | * tipc_link_tunnel(): Send one message via a link belonging to | 2321 | * tipc_link_tunnel(): Send one message via a link belonging to |
2319 | * another bearer. Owner node is locked. | 2322 | * another bearer. Owner node is locked. |
2320 | */ | 2323 | */ |
2321 | void tipc_link_tunnel(struct link *l_ptr, | 2324 | static void tipc_link_tunnel(struct link *l_ptr, |
2322 | struct tipc_msg *tunnel_hdr, | 2325 | struct tipc_msg *tunnel_hdr, |
2323 | struct tipc_msg *msg, | 2326 | struct tipc_msg *msg, |
2324 | u32 selector) | 2327 | u32 selector) |
2325 | { | 2328 | { |
2326 | struct link *tunnel; | 2329 | struct link *tunnel; |
2327 | struct sk_buff *buf; | 2330 | struct sk_buff *buf; |
@@ -2334,7 +2337,7 @@ void tipc_link_tunnel(struct link *l_ptr, | |||
2334 | return; | 2337 | return; |
2335 | } | 2338 | } |
2336 | msg_set_size(tunnel_hdr, length + INT_H_SIZE); | 2339 | msg_set_size(tunnel_hdr, length + INT_H_SIZE); |
2337 | buf = buf_acquire(length + INT_H_SIZE); | 2340 | buf = tipc_buf_acquire(length + INT_H_SIZE); |
2338 | if (!buf) { | 2341 | if (!buf) { |
2339 | warn("Link changeover error, " | 2342 | warn("Link changeover error, " |
2340 | "unable to send tunnel msg\n"); | 2343 | "unable to send tunnel msg\n"); |
@@ -2380,7 +2383,7 @@ void tipc_link_changeover(struct link *l_ptr) | |||
2380 | if (!l_ptr->first_out) { | 2383 | if (!l_ptr->first_out) { |
2381 | struct sk_buff *buf; | 2384 | struct sk_buff *buf; |
2382 | 2385 | ||
2383 | buf = buf_acquire(INT_H_SIZE); | 2386 | buf = tipc_buf_acquire(INT_H_SIZE); |
2384 | if (buf) { | 2387 | if (buf) { |
2385 | skb_copy_to_linear_data(buf, &tunnel_hdr, INT_H_SIZE); | 2388 | skb_copy_to_linear_data(buf, &tunnel_hdr, INT_H_SIZE); |
2386 | msg_set_size(&tunnel_hdr, INT_H_SIZE); | 2389 | msg_set_size(&tunnel_hdr, INT_H_SIZE); |
@@ -2441,7 +2444,7 @@ void tipc_link_send_duplicate(struct link *l_ptr, struct link *tunnel) | |||
2441 | msg_set_ack(msg, mod(l_ptr->next_in_no - 1)); /* Update */ | 2444 | msg_set_ack(msg, mod(l_ptr->next_in_no - 1)); /* Update */ |
2442 | msg_set_bcast_ack(msg, l_ptr->owner->bclink.last_in); | 2445 | msg_set_bcast_ack(msg, l_ptr->owner->bclink.last_in); |
2443 | msg_set_size(&tunnel_hdr, length + INT_H_SIZE); | 2446 | msg_set_size(&tunnel_hdr, length + INT_H_SIZE); |
2444 | outbuf = buf_acquire(length + INT_H_SIZE); | 2447 | outbuf = tipc_buf_acquire(length + INT_H_SIZE); |
2445 | if (outbuf == NULL) { | 2448 | if (outbuf == NULL) { |
2446 | warn("Link changeover error, " | 2449 | warn("Link changeover error, " |
2447 | "unable to send duplicate msg\n"); | 2450 | "unable to send duplicate msg\n"); |
@@ -2477,7 +2480,7 @@ static struct sk_buff *buf_extract(struct sk_buff *skb, u32 from_pos) | |||
2477 | u32 size = msg_size(msg); | 2480 | u32 size = msg_size(msg); |
2478 | struct sk_buff *eb; | 2481 | struct sk_buff *eb; |
2479 | 2482 | ||
2480 | eb = buf_acquire(size); | 2483 | eb = tipc_buf_acquire(size); |
2481 | if (eb) | 2484 | if (eb) |
2482 | skb_copy_to_linear_data(eb, msg, size); | 2485 | skb_copy_to_linear_data(eb, msg, size); |
2483 | return eb; | 2486 | return eb; |
@@ -2605,11 +2608,11 @@ void tipc_link_recv_bundle(struct sk_buff *buf) | |||
2605 | 2608 | ||
2606 | 2609 | ||
2607 | /* | 2610 | /* |
2608 | * tipc_link_send_long_buf: Entry for buffers needing fragmentation. | 2611 | * link_send_long_buf: Entry for buffers needing fragmentation. |
2609 | * The buffer is complete, inclusive total message length. | 2612 | * The buffer is complete, inclusive total message length. |
2610 | * Returns user data length. | 2613 | * Returns user data length. |
2611 | */ | 2614 | */ |
2612 | int tipc_link_send_long_buf(struct link *l_ptr, struct sk_buff *buf) | 2615 | static int link_send_long_buf(struct link *l_ptr, struct sk_buff *buf) |
2613 | { | 2616 | { |
2614 | struct tipc_msg *inmsg = buf_msg(buf); | 2617 | struct tipc_msg *inmsg = buf_msg(buf); |
2615 | struct tipc_msg fragm_hdr; | 2618 | struct tipc_msg fragm_hdr; |
@@ -2648,7 +2651,7 @@ int tipc_link_send_long_buf(struct link *l_ptr, struct sk_buff *buf) | |||
2648 | fragm_sz = rest; | 2651 | fragm_sz = rest; |
2649 | msg_set_type(&fragm_hdr, LAST_FRAGMENT); | 2652 | msg_set_type(&fragm_hdr, LAST_FRAGMENT); |
2650 | } | 2653 | } |
2651 | fragm = buf_acquire(fragm_sz + INT_H_SIZE); | 2654 | fragm = tipc_buf_acquire(fragm_sz + INT_H_SIZE); |
2652 | if (fragm == NULL) { | 2655 | if (fragm == NULL) { |
2653 | warn("Link unable to fragment message\n"); | 2656 | warn("Link unable to fragment message\n"); |
2654 | dsz = -ENOMEM; | 2657 | dsz = -ENOMEM; |
@@ -2753,7 +2756,7 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb, | |||
2753 | buf_discard(fbuf); | 2756 | buf_discard(fbuf); |
2754 | return 0; | 2757 | return 0; |
2755 | } | 2758 | } |
2756 | pbuf = buf_acquire(msg_size(imsg)); | 2759 | pbuf = tipc_buf_acquire(msg_size(imsg)); |
2757 | if (pbuf != NULL) { | 2760 | if (pbuf != NULL) { |
2758 | pbuf->next = *pending; | 2761 | pbuf->next = *pending; |
2759 | *pending = pbuf; | 2762 | *pending = pbuf; |