aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/link.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2011-11-04 13:24:29 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2012-02-24 17:05:16 -0500
commit5f6d9123f1c7ef7297b0da1620988fe16c738e75 (patch)
treef26998d63d8263bdd67a52d54a6f58e0332e0fba /net/tipc/link.c
parenta635b46bd884efc1fc98819cb5a200da255d575c (diff)
tipc: Eliminate trivial buffer manipulation helper routines
Gets rid of two inlined routines that simply call existing sk_buff manipulation routines, since there is no longer any extra processing done by the helper routines. Note that these changes are essentially cosmetic in nature, and have no impact on the actual operation of TIPC. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r--net/tipc/link.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 6cc78a970126..f16e65dd50c0 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -484,7 +484,7 @@ static void link_release_outqueue(struct tipc_link *l_ptr)
484 484
485 while (buf) { 485 while (buf) {
486 next = buf->next; 486 next = buf->next;
487 buf_discard(buf); 487 kfree_skb(buf);
488 buf = next; 488 buf = next;
489 } 489 }
490 l_ptr->first_out = NULL; 490 l_ptr->first_out = NULL;
@@ -503,7 +503,7 @@ void tipc_link_reset_fragments(struct tipc_link *l_ptr)
503 503
504 while (buf) { 504 while (buf) {
505 next = buf->next; 505 next = buf->next;
506 buf_discard(buf); 506 kfree_skb(buf);
507 buf = next; 507 buf = next;
508 } 508 }
509 l_ptr->defragm_buf = NULL; 509 l_ptr->defragm_buf = NULL;
@@ -522,20 +522,20 @@ void tipc_link_stop(struct tipc_link *l_ptr)
522 buf = l_ptr->oldest_deferred_in; 522 buf = l_ptr->oldest_deferred_in;
523 while (buf) { 523 while (buf) {
524 next = buf->next; 524 next = buf->next;
525 buf_discard(buf); 525 kfree_skb(buf);
526 buf = next; 526 buf = next;
527 } 527 }
528 528
529 buf = l_ptr->first_out; 529 buf = l_ptr->first_out;
530 while (buf) { 530 while (buf) {
531 next = buf->next; 531 next = buf->next;
532 buf_discard(buf); 532 kfree_skb(buf);
533 buf = next; 533 buf = next;
534 } 534 }
535 535
536 tipc_link_reset_fragments(l_ptr); 536 tipc_link_reset_fragments(l_ptr);
537 537
538 buf_discard(l_ptr->proto_msg_queue); 538 kfree_skb(l_ptr->proto_msg_queue);
539 l_ptr->proto_msg_queue = NULL; 539 l_ptr->proto_msg_queue = NULL;
540} 540}
541 541
@@ -571,12 +571,12 @@ void tipc_link_reset(struct tipc_link *l_ptr)
571 /* Clean up all queues: */ 571 /* Clean up all queues: */
572 572
573 link_release_outqueue(l_ptr); 573 link_release_outqueue(l_ptr);
574 buf_discard(l_ptr->proto_msg_queue); 574 kfree_skb(l_ptr->proto_msg_queue);
575 l_ptr->proto_msg_queue = NULL; 575 l_ptr->proto_msg_queue = NULL;
576 buf = l_ptr->oldest_deferred_in; 576 buf = l_ptr->oldest_deferred_in;
577 while (buf) { 577 while (buf) {
578 struct sk_buff *next = buf->next; 578 struct sk_buff *next = buf->next;
579 buf_discard(buf); 579 kfree_skb(buf);
580 buf = next; 580 buf = next;
581 } 581 }
582 if (!list_empty(&l_ptr->waiting_ports)) 582 if (!list_empty(&l_ptr->waiting_ports))
@@ -810,7 +810,7 @@ static int link_bundle_buf(struct tipc_link *l_ptr,
810 skb_copy_to_linear_data_offset(bundler, to_pos, buf->data, size); 810 skb_copy_to_linear_data_offset(bundler, to_pos, buf->data, size);
811 msg_set_size(bundler_msg, to_pos + size); 811 msg_set_size(bundler_msg, to_pos + size);
812 msg_set_msgcnt(bundler_msg, msg_msgcnt(bundler_msg) + 1); 812 msg_set_msgcnt(bundler_msg, msg_msgcnt(bundler_msg) + 1);
813 buf_discard(buf); 813 kfree_skb(buf);
814 l_ptr->stats.sent_bundled++; 814 l_ptr->stats.sent_bundled++;
815 return 1; 815 return 1;
816} 816}
@@ -878,10 +878,10 @@ int tipc_link_send_buf(struct tipc_link *l_ptr, struct sk_buff *buf)
878 if (unlikely(queue_size >= queue_limit)) { 878 if (unlikely(queue_size >= queue_limit)) {
879 if (imp <= TIPC_CRITICAL_IMPORTANCE) { 879 if (imp <= TIPC_CRITICAL_IMPORTANCE) {
880 link_schedule_port(l_ptr, msg_origport(msg), size); 880 link_schedule_port(l_ptr, msg_origport(msg), size);
881 buf_discard(buf); 881 kfree_skb(buf);
882 return -ELINKCONG; 882 return -ELINKCONG;
883 } 883 }
884 buf_discard(buf); 884 kfree_skb(buf);
885 if (imp > CONN_MANAGER) { 885 if (imp > CONN_MANAGER) {
886 warn("Resetting link <%s>, send queue full", l_ptr->name); 886 warn("Resetting link <%s>, send queue full", l_ptr->name);
887 tipc_link_reset(l_ptr); 887 tipc_link_reset(l_ptr);
@@ -968,10 +968,10 @@ int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector)
968 if (l_ptr) 968 if (l_ptr)
969 res = tipc_link_send_buf(l_ptr, buf); 969 res = tipc_link_send_buf(l_ptr, buf);
970 else 970 else
971 buf_discard(buf); 971 kfree_skb(buf);
972 tipc_node_unlock(n_ptr); 972 tipc_node_unlock(n_ptr);
973 } else { 973 } else {
974 buf_discard(buf); 974 kfree_skb(buf);
975 } 975 }
976 read_unlock_bh(&tipc_net_lock); 976 read_unlock_bh(&tipc_net_lock);
977 return res; 977 return res;
@@ -1018,7 +1018,7 @@ void tipc_link_send_names(struct list_head *message_list, u32 dest)
1018 1018
1019 list_for_each_safe(buf, temp_buf, ((struct sk_buff *)message_list)) { 1019 list_for_each_safe(buf, temp_buf, ((struct sk_buff *)message_list)) {
1020 list_del((struct list_head *)buf); 1020 list_del((struct list_head *)buf);
1021 buf_discard(buf); 1021 kfree_skb(buf);
1022 } 1022 }
1023} 1023}
1024 1024
@@ -1262,7 +1262,7 @@ again:
1262error: 1262error:
1263 for (; buf_chain; buf_chain = buf) { 1263 for (; buf_chain; buf_chain = buf) {
1264 buf = buf_chain->next; 1264 buf = buf_chain->next;
1265 buf_discard(buf_chain); 1265 kfree_skb(buf_chain);
1266 } 1266 }
1267 return -EFAULT; 1267 return -EFAULT;
1268 } 1268 }
@@ -1316,7 +1316,7 @@ error:
1316 tipc_node_unlock(node); 1316 tipc_node_unlock(node);
1317 for (; buf_chain; buf_chain = buf) { 1317 for (; buf_chain; buf_chain = buf) {
1318 buf = buf_chain->next; 1318 buf = buf_chain->next;
1319 buf_discard(buf_chain); 1319 kfree_skb(buf_chain);
1320 } 1320 }
1321 goto again; 1321 goto again;
1322 } 1322 }
@@ -1324,7 +1324,7 @@ error:
1324reject: 1324reject:
1325 for (; buf_chain; buf_chain = buf) { 1325 for (; buf_chain; buf_chain = buf) {
1326 buf = buf_chain->next; 1326 buf = buf_chain->next;
1327 buf_discard(buf_chain); 1327 kfree_skb(buf_chain);
1328 } 1328 }
1329 return tipc_port_reject_sections(sender, hdr, msg_sect, num_sect, 1329 return tipc_port_reject_sections(sender, hdr, msg_sect, num_sect,
1330 total_len, TIPC_ERR_NO_NODE); 1330 total_len, TIPC_ERR_NO_NODE);
@@ -1390,7 +1390,7 @@ u32 tipc_link_push_packet(struct tipc_link *l_ptr)
1390 msg_set_bcast_ack(buf_msg(buf), l_ptr->owner->bclink.last_in); 1390 msg_set_bcast_ack(buf_msg(buf), l_ptr->owner->bclink.last_in);
1391 if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) { 1391 if (tipc_bearer_send(l_ptr->b_ptr, buf, &l_ptr->media_addr)) {
1392 l_ptr->unacked_window = 0; 1392 l_ptr->unacked_window = 0;
1393 buf_discard(buf); 1393 kfree_skb(buf);
1394 l_ptr->proto_msg_queue = NULL; 1394 l_ptr->proto_msg_queue = NULL;
1395 return 0; 1395 return 0;
1396 } else { 1396 } else {
@@ -1679,7 +1679,7 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *b_ptr)
1679 1679
1680 /* Ensure message data is a single contiguous unit */ 1680 /* Ensure message data is a single contiguous unit */
1681 1681
1682 if (unlikely(buf_linearize(buf))) 1682 if (unlikely(skb_linearize(buf)))
1683 goto cont; 1683 goto cont;
1684 1684
1685 /* Handle arrival of a non-unicast link message */ 1685 /* Handle arrival of a non-unicast link message */
@@ -1744,7 +1744,7 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *b_ptr)
1744 less_eq(buf_seqno(crs), ackd)) { 1744 less_eq(buf_seqno(crs), ackd)) {
1745 struct sk_buff *next = crs->next; 1745 struct sk_buff *next = crs->next;
1746 1746
1747 buf_discard(crs); 1747 kfree_skb(crs);
1748 crs = next; 1748 crs = next;
1749 released++; 1749 released++;
1750 } 1750 }
@@ -1820,7 +1820,7 @@ deliver:
1820 } 1820 }
1821 break; 1821 break;
1822 default: 1822 default:
1823 buf_discard(buf); 1823 kfree_skb(buf);
1824 buf = NULL; 1824 buf = NULL;
1825 break; 1825 break;
1826 } 1826 }
@@ -1851,7 +1851,7 @@ deliver:
1851 } 1851 }
1852 tipc_node_unlock(n_ptr); 1852 tipc_node_unlock(n_ptr);
1853cont: 1853cont:
1854 buf_discard(buf); 1854 kfree_skb(buf);
1855 } 1855 }
1856 read_unlock_bh(&tipc_net_lock); 1856 read_unlock_bh(&tipc_net_lock);
1857} 1857}
@@ -1891,7 +1891,7 @@ u32 tipc_link_defer_pkt(struct sk_buff **head, struct sk_buff **tail,
1891 u32 curr_seqno = buf_seqno(queue_buf); 1891 u32 curr_seqno = buf_seqno(queue_buf);
1892 1892
1893 if (seq_no == curr_seqno) { 1893 if (seq_no == curr_seqno) {
1894 buf_discard(buf); 1894 kfree_skb(buf);
1895 return 0; 1895 return 0;
1896 } 1896 }
1897 1897
@@ -1932,7 +1932,7 @@ static void link_handle_out_of_seq_msg(struct tipc_link *l_ptr,
1932 1932
1933 if (less(seq_no, mod(l_ptr->next_in_no))) { 1933 if (less(seq_no, mod(l_ptr->next_in_no))) {
1934 l_ptr->stats.duplicates++; 1934 l_ptr->stats.duplicates++;
1935 buf_discard(buf); 1935 kfree_skb(buf);
1936 return; 1936 return;
1937 } 1937 }
1938 1938
@@ -1961,7 +1961,7 @@ void tipc_link_send_proto_msg(struct tipc_link *l_ptr, u32 msg_typ,
1961 /* Discard any previous message that was deferred due to congestion */ 1961 /* Discard any previous message that was deferred due to congestion */
1962 1962
1963 if (l_ptr->proto_msg_queue) { 1963 if (l_ptr->proto_msg_queue) {
1964 buf_discard(l_ptr->proto_msg_queue); 1964 kfree_skb(l_ptr->proto_msg_queue);
1965 l_ptr->proto_msg_queue = NULL; 1965 l_ptr->proto_msg_queue = NULL;
1966 } 1966 }
1967 1967
@@ -2060,7 +2060,7 @@ void tipc_link_send_proto_msg(struct tipc_link *l_ptr, u32 msg_typ,
2060 /* Discard message if it was sent successfully */ 2060 /* Discard message if it was sent successfully */
2061 2061
2062 l_ptr->unacked_window = 0; 2062 l_ptr->unacked_window = 0;
2063 buf_discard(buf); 2063 kfree_skb(buf);
2064} 2064}
2065 2065
2066/* 2066/*
@@ -2204,7 +2204,7 @@ static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf)
2204 break; 2204 break;
2205 } 2205 }
2206exit: 2206exit:
2207 buf_discard(buf); 2207 kfree_skb(buf);
2208} 2208}
2209 2209
2210 2210
@@ -2402,7 +2402,7 @@ static int link_recv_changeover_msg(struct tipc_link **l_ptr,
2402 warn("Link changeover error, duplicate msg dropped\n"); 2402 warn("Link changeover error, duplicate msg dropped\n");
2403 goto exit; 2403 goto exit;
2404 } 2404 }
2405 buf_discard(tunnel_buf); 2405 kfree_skb(tunnel_buf);
2406 return 1; 2406 return 1;
2407 } 2407 }
2408 2408
@@ -2434,7 +2434,7 @@ static int link_recv_changeover_msg(struct tipc_link **l_ptr,
2434 } else { 2434 } else {
2435 *buf = buf_extract(tunnel_buf, INT_H_SIZE); 2435 *buf = buf_extract(tunnel_buf, INT_H_SIZE);
2436 if (*buf != NULL) { 2436 if (*buf != NULL) {
2437 buf_discard(tunnel_buf); 2437 kfree_skb(tunnel_buf);
2438 return 1; 2438 return 1;
2439 } else { 2439 } else {
2440 warn("Link changeover error, original msg dropped\n"); 2440 warn("Link changeover error, original msg dropped\n");
@@ -2442,7 +2442,7 @@ static int link_recv_changeover_msg(struct tipc_link **l_ptr,
2442 } 2442 }
2443exit: 2443exit:
2444 *buf = NULL; 2444 *buf = NULL;
2445 buf_discard(tunnel_buf); 2445 kfree_skb(tunnel_buf);
2446 return 0; 2446 return 0;
2447} 2447}
2448 2448
@@ -2464,7 +2464,7 @@ void tipc_link_recv_bundle(struct sk_buff *buf)
2464 pos += align(msg_size(buf_msg(obuf))); 2464 pos += align(msg_size(buf_msg(obuf)));
2465 tipc_net_route_msg(obuf); 2465 tipc_net_route_msg(obuf);
2466 } 2466 }
2467 buf_discard(buf); 2467 kfree_skb(buf);
2468} 2468}
2469 2469
2470/* 2470/*
@@ -2513,11 +2513,11 @@ static int link_send_long_buf(struct tipc_link *l_ptr, struct sk_buff *buf)
2513 } 2513 }
2514 fragm = tipc_buf_acquire(fragm_sz + INT_H_SIZE); 2514 fragm = tipc_buf_acquire(fragm_sz + INT_H_SIZE);
2515 if (fragm == NULL) { 2515 if (fragm == NULL) {
2516 buf_discard(buf); 2516 kfree_skb(buf);
2517 while (buf_chain) { 2517 while (buf_chain) {
2518 buf = buf_chain; 2518 buf = buf_chain;
2519 buf_chain = buf_chain->next; 2519 buf_chain = buf_chain->next;
2520 buf_discard(buf); 2520 kfree_skb(buf);
2521 } 2521 }
2522 return -ENOMEM; 2522 return -ENOMEM;
2523 } 2523 }
@@ -2534,7 +2534,7 @@ static int link_send_long_buf(struct tipc_link *l_ptr, struct sk_buff *buf)
2534 crs += fragm_sz; 2534 crs += fragm_sz;
2535 msg_set_type(&fragm_hdr, FRAGMENT); 2535 msg_set_type(&fragm_hdr, FRAGMENT);
2536 } 2536 }
2537 buf_discard(buf); 2537 kfree_skb(buf);
2538 2538
2539 /* Append chain of fragments to send queue & send them */ 2539 /* Append chain of fragments to send queue & send them */
2540 2540
@@ -2621,7 +2621,7 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
2621 if (msg_type(imsg) == TIPC_MCAST_MSG) 2621 if (msg_type(imsg) == TIPC_MCAST_MSG)
2622 max = TIPC_MAX_USER_MSG_SIZE + MCAST_H_SIZE; 2622 max = TIPC_MAX_USER_MSG_SIZE + MCAST_H_SIZE;
2623 if (msg_size(imsg) > max) { 2623 if (msg_size(imsg) > max) {
2624 buf_discard(fbuf); 2624 kfree_skb(fbuf);
2625 return 0; 2625 return 0;
2626 } 2626 }
2627 pbuf = tipc_buf_acquire(msg_size(imsg)); 2627 pbuf = tipc_buf_acquire(msg_size(imsg));
@@ -2637,10 +2637,10 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
2637 set_expected_frags(pbuf, exp_fragm_cnt - 1); 2637 set_expected_frags(pbuf, exp_fragm_cnt - 1);
2638 } else { 2638 } else {
2639 dbg("Link unable to reassemble fragmented message\n"); 2639 dbg("Link unable to reassemble fragmented message\n");
2640 buf_discard(fbuf); 2640 kfree_skb(fbuf);
2641 return -1; 2641 return -1;
2642 } 2642 }
2643 buf_discard(fbuf); 2643 kfree_skb(fbuf);
2644 return 0; 2644 return 0;
2645 } else if (pbuf && (msg_type(fragm) != FIRST_FRAGMENT)) { 2645 } else if (pbuf && (msg_type(fragm) != FIRST_FRAGMENT)) {
2646 u32 dsz = msg_data_sz(fragm); 2646 u32 dsz = msg_data_sz(fragm);
@@ -2649,7 +2649,7 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
2649 u32 exp_frags = get_expected_frags(pbuf) - 1; 2649 u32 exp_frags = get_expected_frags(pbuf) - 1;
2650 skb_copy_to_linear_data_offset(pbuf, crs, 2650 skb_copy_to_linear_data_offset(pbuf, crs,
2651 msg_data(fragm), dsz); 2651 msg_data(fragm), dsz);
2652 buf_discard(fbuf); 2652 kfree_skb(fbuf);
2653 2653
2654 /* Is message complete? */ 2654 /* Is message complete? */
2655 2655
@@ -2666,7 +2666,7 @@ int tipc_link_recv_fragment(struct sk_buff **pending, struct sk_buff **fb,
2666 set_expected_frags(pbuf, exp_frags); 2666 set_expected_frags(pbuf, exp_frags);
2667 return 0; 2667 return 0;
2668 } 2668 }
2669 buf_discard(fbuf); 2669 kfree_skb(fbuf);
2670 return 0; 2670 return 0;
2671} 2671}
2672 2672
@@ -2697,7 +2697,7 @@ static void link_check_defragm_bufs(struct tipc_link *l_ptr)
2697 prev->next = buf->next; 2697 prev->next = buf->next;
2698 else 2698 else
2699 l_ptr->defragm_buf = buf->next; 2699 l_ptr->defragm_buf = buf->next;
2700 buf_discard(buf); 2700 kfree_skb(buf);
2701 } 2701 }
2702 buf = next; 2702 buf = next;
2703 } 2703 }
@@ -3072,7 +3072,7 @@ struct sk_buff *tipc_link_cmd_show_stats(const void *req_tlv_area, int req_tlv_s
3072 str_len = tipc_link_stats((char *)TLV_DATA(req_tlv_area), 3072 str_len = tipc_link_stats((char *)TLV_DATA(req_tlv_area),
3073 (char *)TLV_DATA(rep_tlv), MAX_LINK_STATS_INFO); 3073 (char *)TLV_DATA(rep_tlv), MAX_LINK_STATS_INFO);
3074 if (!str_len) { 3074 if (!str_len) {
3075 buf_discard(buf); 3075 kfree_skb(buf);
3076 return tipc_cfg_reply_error_string("link not found"); 3076 return tipc_cfg_reply_error_string("link not found");
3077 } 3077 }
3078 3078