]> err.no Git - linux-2.6/blobdiff - net/tipc/node.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[linux-2.6] / net / tipc / node.c
index 5f097547d3e374c2fb92e8b94f9105fb89f77244..861322b935daf1be3aee4ac4e5eca284c4a7c89a 100644 (file)
@@ -77,7 +77,7 @@ struct node *tipc_node_create(u32 addr)
                
        memset(n_ptr, 0, sizeof(*n_ptr));
        n_ptr->addr = addr;
-       n_ptr->lock =  SPIN_LOCK_UNLOCKED;      
+                spin_lock_init(&n_ptr->lock);
        INIT_LIST_HEAD(&n_ptr->nsub);
        n_ptr->owner = c_ptr;
        tipc_cltr_attach_node(c_ptr, n_ptr);
@@ -125,6 +125,8 @@ void tipc_node_link_up(struct node *n_ptr, struct link *l_ptr)
 {
        struct link **active = &n_ptr->active_links[0];
 
+       n_ptr->working_links++;
+
        info("Established link <%s> on network plane %c\n",
             l_ptr->name, l_ptr->b_ptr->net_plane);
        
@@ -185,6 +187,8 @@ void tipc_node_link_down(struct node *n_ptr, struct link *l_ptr)
 {
        struct link **active;
 
+       n_ptr->working_links--;
+
        if (!tipc_link_is_active(l_ptr)) {
                info("Lost standby link <%s> on network plane %c\n",
                     l_ptr->name, l_ptr->b_ptr->net_plane);
@@ -214,8 +218,7 @@ int tipc_node_has_active_links(struct node *n_ptr)
 
 int tipc_node_has_redundant_links(struct node *n_ptr)
 {
-       return (tipc_node_has_active_links(n_ptr) &&
-               (n_ptr->active_links[0] != n_ptr->active_links[1]));
+       return (n_ptr->working_links > 1);
 }
 
 static int tipc_node_has_active_routes(struct node *n_ptr)