mmc: s3c6410: enable ADMA feature in 6410 sdhci controller
[safe/jmp/linux-2.6] / net / tipc / cluster.c
index b46b518..e68f705 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * net/tipc/cluster.c: TIPC cluster management routines
- * 
+ *
  * Copyright (c) 2000-2006, Ericsson AB
  * Copyright (c) 2005, Wind River Systems
  * All rights reserved.
@@ -48,15 +48,15 @@ static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf,
                                u32 lower, u32 upper);
 static struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest);
 
-struct node **tipc_local_nodes = NULL;
-struct node_map tipc_cltr_bcast_nodes = {0,{0,}};
+struct tipc_node **tipc_local_nodes = NULL;
+struct tipc_node_map tipc_cltr_bcast_nodes = {0,{0,}};
 u32 tipc_highest_allowed_slave = 0;
 
 struct cluster *tipc_cltr_create(u32 addr)
 {
        struct _zone *z_ptr;
        struct cluster *c_ptr;
-       int max_nodes; 
+       int max_nodes;
 
        c_ptr = kzalloc(sizeof(*c_ptr), GFP_ATOMIC);
        if (c_ptr == NULL) {
@@ -81,7 +81,7 @@ struct cluster *tipc_cltr_create(u32 addr)
                tipc_local_nodes = c_ptr->nodes;
        c_ptr->highest_slave = LOWEST_SLAVE - 1;
        c_ptr->highest_node = 0;
-       
+
        z_ptr = tipc_zone_find(tipc_zone(addr));
        if (!z_ptr) {
                z_ptr = tipc_zone_create(addr);
@@ -115,7 +115,7 @@ void tipc_cltr_delete(struct cluster *c_ptr)
 
 u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr)
 {
-       struct node *n_ptr;
+       struct tipc_node *n_ptr;
        u32 n_num = tipc_node(addr) + 1;
 
        if (!c_ptr)
@@ -133,7 +133,7 @@ u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr)
        return 0;
 }
 
-void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr)
+void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr)
 {
        u32 n_num = tipc_node(n_ptr->addr);
        u32 max_n_num = tipc_max_nodes;
@@ -142,7 +142,7 @@ void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr)
                max_n_num = tipc_highest_allowed_slave;
        assert(n_num > 0);
        assert(n_num <= max_n_num);
-       assert(c_ptr->nodes[n_num] == 0);
+       assert(c_ptr->nodes[n_num] == NULL);
        c_ptr->nodes[n_num] = n_ptr;
        if (n_num > c_ptr->highest_node)
                c_ptr->highest_node = n_num;
@@ -150,7 +150,7 @@ void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr)
 
 /**
  * tipc_cltr_select_router - select router to a cluster
- * 
+ *
  * Uses deterministic and fair algorithm.
  */
 
@@ -192,11 +192,11 @@ u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref)
 
 /**
  * tipc_cltr_select_node - select destination node within a remote cluster
- * 
+ *
  * Uses deterministic and fair algorithm.
  */
 
-struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector)
+struct tipc_node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector)
 {
        u32 n_num;
        u32 mask = tipc_max_nodes;
@@ -238,7 +238,7 @@ static struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest)
        if (buf) {
                msg = buf_msg(buf);
                memset((char *)msg, 0, size);
-               msg_init(msg, ROUTE_DISTRIBUTOR, 0, TIPC_OK, INT_H_SIZE, dest);
+               tipc_msg_init(msg, ROUTE_DISTRIBUTOR, 0, INT_H_SIZE, dest);
        }
        return buf;
 }
@@ -295,7 +295,7 @@ void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest)
                msg_set_remote_node(msg, c_ptr->addr);
                msg_set_type(msg, SLAVE_ROUTING_TABLE);
                for (n_num = LOWEST_SLAVE; n_num <= highest; n_num++) {
-                       if (c_ptr->nodes[n_num] && 
+                       if (c_ptr->nodes[n_num] &&
                            tipc_node_has_active_links(c_ptr->nodes[n_num])) {
                                send = 1;
                                msg_set_dataoctet(msg, n_num);
@@ -329,7 +329,7 @@ void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest)
                msg_set_remote_node(msg, c_ptr->addr);
                msg_set_type(msg, EXT_ROUTING_TABLE);
                for (n_num = 1; n_num <= highest; n_num++) {
-                       if (c_ptr->nodes[n_num] && 
+                       if (c_ptr->nodes[n_num] &&
                            tipc_node_has_active_links(c_ptr->nodes[n_num])) {
                                send = 1;
                                msg_set_dataoctet(msg, n_num);
@@ -360,7 +360,7 @@ void tipc_cltr_send_local_routes(struct cluster *c_ptr, u32 dest)
                msg_set_remote_node(msg, c_ptr->addr);
                msg_set_type(msg, LOCAL_ROUTING_TABLE);
                for (n_num = 1; n_num <= highest; n_num++) {
-                       if (c_ptr->nodes[n_num] && 
+                       if (c_ptr->nodes[n_num] &&
                            tipc_node_has_active_links(c_ptr->nodes[n_num])) {
                                send = 1;
                                msg_set_dataoctet(msg, n_num);
@@ -379,7 +379,7 @@ void tipc_cltr_recv_routing_table(struct sk_buff *buf)
 {
        struct tipc_msg *msg = buf_msg(buf);
        struct cluster *c_ptr;
-       struct node *n_ptr;
+       struct tipc_node *n_ptr;
        unchar *node_table;
        u32 table_size;
        u32 router;
@@ -437,11 +437,11 @@ void tipc_cltr_recv_routing_table(struct sk_buff *buf)
                break;
        case ROUTE_ADDITION:
                if (!is_slave(tipc_own_addr)) {
-                       assert(!in_own_cluster(c_ptr->addr)
-                              || is_slave(rem_node));
+                       assert(!in_own_cluster(c_ptr->addr) ||
+                              is_slave(rem_node));
                } else {
-                       assert(in_own_cluster(c_ptr->addr)
-                              && !is_slave(rem_node));
+                       assert(in_own_cluster(c_ptr->addr) &&
+                              !is_slave(rem_node));
                }
                n_ptr = c_ptr->nodes[tipc_node(rem_node)];
                if (!n_ptr)
@@ -451,11 +451,11 @@ void tipc_cltr_recv_routing_table(struct sk_buff *buf)
                break;
        case ROUTE_REMOVAL:
                if (!is_slave(tipc_own_addr)) {
-                       assert(!in_own_cluster(c_ptr->addr)
-                              || is_slave(rem_node));
+                       assert(!in_own_cluster(c_ptr->addr) ||
+                              is_slave(rem_node));
                } else {
-                       assert(in_own_cluster(c_ptr->addr)
-                              && !is_slave(rem_node));
+                       assert(in_own_cluster(c_ptr->addr) &&
+                              !is_slave(rem_node));
                }
                n_ptr = c_ptr->nodes[tipc_node(rem_node)];
                if (n_ptr)
@@ -492,14 +492,14 @@ void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router)
 }
 
 /**
- * tipc_cltr_multicast - multicast message to local nodes 
+ * tipc_cltr_multicast - multicast message to local nodes
  */
 
 static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf,
                         u32 lower, u32 upper)
 {
        struct sk_buff *buf_copy;
-       struct node *n_ptr;
+       struct tipc_node *n_ptr;
        u32 n_num;
        u32 tstop;
 
@@ -534,7 +534,7 @@ void tipc_cltr_broadcast(struct sk_buff *buf)
 {
        struct sk_buff *buf_copy;
        struct cluster *c_ptr;
-       struct node *n_ptr;
+       struct tipc_node *n_ptr;
        u32 n_num;
        u32 tstart;
        u32 tstop;
@@ -554,9 +554,9 @@ void tipc_cltr_broadcast(struct sk_buff *buf)
                                        buf_copy = skb_copy(buf, GFP_ATOMIC);
                                        if (buf_copy == NULL)
                                                goto exit;
-                                       msg_set_destnode(buf_msg(buf_copy), 
+                                       msg_set_destnode(buf_msg(buf_copy),
                                                         n_ptr->addr);
-                                       tipc_link_send(buf_copy, n_ptr->addr, 
+                                       tipc_link_send(buf_copy, n_ptr->addr,
                                                       n_ptr->addr);
                                }
                        }
@@ -571,6 +571,6 @@ exit:
 int tipc_cltr_init(void)
 {
        tipc_highest_allowed_slave = LOWEST_SLAVE + tipc_max_slaves;
-       return tipc_cltr_create(tipc_own_addr) ? TIPC_OK : -ENOMEM;
+       return tipc_cltr_create(tipc_own_addr) ? 0 : -ENOMEM;
 }