Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[sfrench/cifs-2.6.git] / net / tipc / bcast.c
index bf860d9e75af2363e6538ee525c60bf7c0821b6c..95ab5ef92920fddf34c02478973b98ebbe96ba59 100644 (file)
@@ -41,9 +41,9 @@
 #include "bcast.h"
 #include "name_distr.h"
 
-#define MAX_PKT_DEFAULT_MCAST 1500     /* bcast link max packet size (fixed) */
-
-#define BCLINK_WIN_DEFAULT 20          /* bcast link window size (default) */
+#define        MAX_PKT_DEFAULT_MCAST   1500    /* bcast link max packet size (fixed) */
+#define        BCLINK_WIN_DEFAULT      20      /* bcast link window size (default) */
+#define        BCBEARER                MAX_BEARERS
 
 /**
  * struct tipc_bcbearer_pair - a pair of bearers used by broadcast link
@@ -356,9 +356,9 @@ static void bclink_peek_nack(struct tipc_msg *msg)
 }
 
 /*
- * tipc_bclink_send_msg - broadcast a packet to all nodes in cluster
+ * tipc_bclink_xmit - broadcast a packet to all nodes in cluster
  */
-int tipc_bclink_send_msg(struct sk_buff *buf)
+int tipc_bclink_xmit(struct sk_buff *buf)
 {
        int res;
 
@@ -370,7 +370,7 @@ int tipc_bclink_send_msg(struct sk_buff *buf)
                goto exit;
        }
 
-       res = tipc_link_send_buf(bcl, buf);
+       res = __tipc_link_xmit(bcl, buf);
        if (likely(res >= 0)) {
                bclink_set_last_sent();
                bcl->stats.queue_sz_counts++;
@@ -399,19 +399,18 @@ static void bclink_accept_pkt(struct tipc_node *node, u32 seqno)
         */
 
        if (((seqno - tipc_own_addr) % TIPC_MIN_LINK_WIN) == 0) {
-               tipc_link_send_proto_msg(
-                       node->active_links[node->addr & 1],
-                       STATE_MSG, 0, 0, 0, 0, 0);
+               tipc_link_proto_xmit(node->active_links[node->addr & 1],
+                                    STATE_MSG, 0, 0, 0, 0, 0);
                bcl->stats.sent_acks++;
        }
 }
 
 /**
- * tipc_bclink_recv_pkt - receive a broadcast packet, and deliver upwards
+ * tipc_bclink_rcv - receive a broadcast packet, and deliver upwards
  *
  * tipc_net_lock is read_locked, no other locks set
  */
-void tipc_bclink_recv_pkt(struct sk_buff *buf)
+void tipc_bclink_rcv(struct sk_buff *buf)
 {
        struct tipc_msg *msg = buf_msg(buf);
        struct tipc_node *node;
@@ -468,7 +467,7 @@ receive:
                        spin_unlock_bh(&bc_lock);
                        tipc_node_unlock(node);
                        if (likely(msg_mcast(msg)))
-                               tipc_port_recv_mcast(buf, NULL);
+                               tipc_port_mcast_rcv(buf, NULL);
                        else
                                kfree_skb(buf);
                } else if (msg_user(msg) == MSG_BUNDLER) {
@@ -478,12 +477,12 @@ receive:
                        bcl->stats.recv_bundled += msg_msgcnt(msg);
                        spin_unlock_bh(&bc_lock);
                        tipc_node_unlock(node);
-                       tipc_link_recv_bundle(buf);
+                       tipc_link_bundle_rcv(buf);
                } else if (msg_user(msg) == MSG_FRAGMENTER) {
                        int ret;
-                       ret = tipc_link_recv_fragment(&node->bclink.reasm_head,
-                                                     &node->bclink.reasm_tail,
-                                                     &buf);
+                       ret = tipc_link_frag_rcv(&node->bclink.reasm_head,
+                                                &node->bclink.reasm_tail,
+                                                &buf);
                        if (ret == LINK_REASM_ERROR)
                                goto unlock;
                        spin_lock_bh(&bc_lock);
@@ -503,7 +502,7 @@ receive:
                        bclink_accept_pkt(node, seqno);
                        spin_unlock_bh(&bc_lock);
                        tipc_node_unlock(node);
-                       tipc_named_recv(buf);
+                       tipc_named_rcv(buf);
                } else {
                        spin_lock_bh(&bc_lock);
                        bclink_accept_pkt(node, seqno);
@@ -669,9 +668,8 @@ void tipc_bcbearer_sort(void)
        memset(bp_temp, 0, sizeof(bcbearer->bpairs_temp));
 
        for (b_index = 0; b_index < MAX_BEARERS; b_index++) {
-               struct tipc_bearer *b = &tipc_bearers[b_index];
-
-               if (!b->active || !b->nodes.count)
+               struct tipc_bearer *b = bearer_list[b_index];
+               if (!b || !b->nodes.count)
                        continue;
 
                if (!bp_temp[b->priority].primary)
@@ -785,8 +783,8 @@ void tipc_bclink_init(void)
        bcl->owner = &bclink->node;
        bcl->max_pkt = MAX_PKT_DEFAULT_MCAST;
        tipc_link_set_queue_limits(bcl, BCLINK_WIN_DEFAULT);
-       spin_lock_init(&bcbearer->bearer.lock);
        bcl->b_ptr = &bcbearer->bearer;
+       bearer_list[BCBEARER] = &bcbearer->bearer;
        bcl->state = WORKING_WORKING;
        strlcpy(bcl->name, tipc_bclink_name, TIPC_MAX_LINK_NAME);
 }
@@ -797,6 +795,7 @@ void tipc_bclink_stop(void)
        tipc_link_purge_queues(bcl);
        spin_unlock_bh(&bc_lock);
 
+       bearer_list[BCBEARER] = NULL;
        memset(bclink, 0, sizeof(*bclink));
        memset(bcbearer, 0, sizeof(*bcbearer));
 }