summaryrefslogtreecommitdiffstats
path: root/net/tipc/bcast.c
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2014-05-14 05:39:12 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-14 15:19:48 -0400
commit37e22164a8a3c39bdad45aa463b1e69a1fdf4110 (patch)
treef59a133e852df71ad5d34615f60d08483ec1ed18 /net/tipc/bcast.c
parent5074ab89c555dd130ceeac129546670423d634b8 (diff)
tipc: rename and move message reassembly function
The function tipc_link_frag_rcv() is in reality a re-entrant generic message reassemby function that has nothing in particular to do with the link, where it is defined now. This becomes obvious when we see the need to call the function from other places in the code. In this commit rename it to tipc_buf_append() and move it to the file msg.c. We also simplify its signature by moving the tail pointer to the control block of the head buffer, hence making the head buffer self-contained. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Reviewed-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/bcast.c')
-rw-r--r--net/tipc/bcast.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index a0978d0890cb..671f9817b4f4 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -506,18 +506,14 @@ receive:
506 tipc_node_unlock(node); 506 tipc_node_unlock(node);
507 tipc_link_bundle_rcv(buf); 507 tipc_link_bundle_rcv(buf);
508 } else if (msg_user(msg) == MSG_FRAGMENTER) { 508 } else if (msg_user(msg) == MSG_FRAGMENTER) {
509 int ret; 509 tipc_buf_append(&node->bclink.reasm_buf, &buf);
510 ret = tipc_link_frag_rcv(&node->bclink.reasm_head, 510 if (unlikely(!buf && !node->bclink.reasm_buf))
511 &node->bclink.reasm_tail,
512 &buf);
513 if (ret == LINK_REASM_ERROR)
514 goto unlock; 511 goto unlock;
515 tipc_bclink_lock(); 512 tipc_bclink_lock();
516 bclink_accept_pkt(node, seqno); 513 bclink_accept_pkt(node, seqno);
517 bcl->stats.recv_fragments++; 514 bcl->stats.recv_fragments++;
518 if (ret == LINK_REASM_COMPLETE) { 515 if (buf) {
519 bcl->stats.recv_fragmented++; 516 bcl->stats.recv_fragmented++;
520 /* Point msg to inner header */
521 msg = buf_msg(buf); 517 msg = buf_msg(buf);
522 tipc_bclink_unlock(); 518 tipc_bclink_unlock();
523 goto receive; 519 goto receive;