diff options
author | Allan Stephens <Allan.Stephens@windriver.com> | 2010-12-31 13:59:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-01 16:57:49 -0500 |
commit | 8f92df6ad49da958d97e171762d0a97a3dc738f1 (patch) | |
tree | ad848109f978d225b42ea219d7f45f10aa008a2c /net/tipc/node.c | |
parent | 51a8e4dee7653698ba4c6e7de71053665f075273 (diff) |
tipc: Remove prototype code for supporting multiple clusters
Eliminates routines, data structures, and files that were intended
to allow TIPC to support a network containing multiple clusters.
Currently, TIPC supports only networks consisting of a single cluster
within a single zone, so this code is unnecessary.
Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r-- | net/tipc/node.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index c47cc69eb575..58e189bf5c96 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -62,9 +62,9 @@ u32 tipc_own_tag = 0; | |||
62 | 62 | ||
63 | struct tipc_node *tipc_node_create(u32 addr) | 63 | struct tipc_node *tipc_node_create(u32 addr) |
64 | { | 64 | { |
65 | struct cluster *c_ptr; | ||
66 | struct tipc_node *n_ptr; | 65 | struct tipc_node *n_ptr; |
67 | struct tipc_node **curr_node; | 66 | struct tipc_node **curr_node; |
67 | u32 n_num; | ||
68 | 68 | ||
69 | spin_lock_bh(&node_create_lock); | 69 | spin_lock_bh(&node_create_lock); |
70 | 70 | ||
@@ -84,21 +84,14 @@ struct tipc_node *tipc_node_create(u32 addr) | |||
84 | return NULL; | 84 | return NULL; |
85 | } | 85 | } |
86 | 86 | ||
87 | c_ptr = tipc_cltr_find(addr); | ||
88 | if (!c_ptr) { | ||
89 | c_ptr = tipc_cltr_create(addr); | ||
90 | } | ||
91 | if (!c_ptr) { | ||
92 | spin_unlock_bh(&node_create_lock); | ||
93 | kfree(n_ptr); | ||
94 | return NULL; | ||
95 | } | ||
96 | |||
97 | n_ptr->addr = addr; | 87 | n_ptr->addr = addr; |
98 | spin_lock_init(&n_ptr->lock); | 88 | spin_lock_init(&n_ptr->lock); |
99 | INIT_LIST_HEAD(&n_ptr->nsub); | 89 | INIT_LIST_HEAD(&n_ptr->nsub); |
100 | n_ptr->owner = c_ptr; | 90 | |
101 | tipc_cltr_attach_node(c_ptr, n_ptr); | 91 | n_num = tipc_node(addr); |
92 | tipc_net.nodes[n_num] = n_ptr; | ||
93 | if (n_num > tipc_net.highest_node) | ||
94 | tipc_net.highest_node = n_num; | ||
102 | 95 | ||
103 | /* Insert node into ordered list */ | 96 | /* Insert node into ordered list */ |
104 | for (curr_node = &tipc_nodes; *curr_node; | 97 | for (curr_node = &tipc_nodes; *curr_node; |
@@ -115,11 +108,19 @@ struct tipc_node *tipc_node_create(u32 addr) | |||
115 | 108 | ||
116 | void tipc_node_delete(struct tipc_node *n_ptr) | 109 | void tipc_node_delete(struct tipc_node *n_ptr) |
117 | { | 110 | { |
111 | u32 n_num; | ||
112 | |||
118 | if (!n_ptr) | 113 | if (!n_ptr) |
119 | return; | 114 | return; |
120 | 115 | ||
121 | dbg("node %x deleted\n", n_ptr->addr); | 116 | dbg("node %x deleted\n", n_ptr->addr); |
117 | n_num = tipc_node(n_ptr->addr); | ||
118 | tipc_net.nodes[n_num] = NULL; | ||
122 | kfree(n_ptr); | 119 | kfree(n_ptr); |
120 | |||
121 | while (!tipc_net.nodes[tipc_net.highest_node]) | ||
122 | if (--tipc_net.highest_node == 0) | ||
123 | break; | ||
123 | } | 124 | } |
124 | 125 | ||
125 | 126 | ||
@@ -324,7 +325,7 @@ static void node_established_contact(struct tipc_node *n_ptr) | |||
324 | n_ptr->bclink.acked = tipc_bclink_get_last_sent(); | 325 | n_ptr->bclink.acked = tipc_bclink_get_last_sent(); |
325 | 326 | ||
326 | if (n_ptr->bclink.supported) { | 327 | if (n_ptr->bclink.supported) { |
327 | tipc_nmap_add(&tipc_cltr_bcast_nodes, n_ptr->addr); | 328 | tipc_nmap_add(&tipc_bcast_nmap, n_ptr->addr); |
328 | if (n_ptr->addr < tipc_own_addr) | 329 | if (n_ptr->addr < tipc_own_addr) |
329 | tipc_own_tag++; | 330 | tipc_own_tag++; |
330 | } | 331 | } |
@@ -361,13 +362,11 @@ static void node_lost_contact(struct tipc_node *n_ptr) | |||
361 | buf_discard(n_ptr->bclink.defragm); | 362 | buf_discard(n_ptr->bclink.defragm); |
362 | n_ptr->bclink.defragm = NULL; | 363 | n_ptr->bclink.defragm = NULL; |
363 | } | 364 | } |
364 | if (in_own_cluster(n_ptr->addr) && n_ptr->bclink.supported) { | ||
365 | tipc_bclink_acknowledge(n_ptr, mod(n_ptr->bclink.acked + 10000)); | ||
366 | } | ||
367 | 365 | ||
368 | /* Update routing tables */ | ||
369 | if (n_ptr->bclink.supported) { | 366 | if (n_ptr->bclink.supported) { |
370 | tipc_nmap_remove(&tipc_cltr_bcast_nodes, n_ptr->addr); | 367 | tipc_bclink_acknowledge(n_ptr, |
368 | mod(n_ptr->bclink.acked + 10000)); | ||
369 | tipc_nmap_remove(&tipc_bcast_nmap, n_ptr->addr); | ||
371 | if (n_ptr->addr < tipc_own_addr) | 370 | if (n_ptr->addr < tipc_own_addr) |
372 | tipc_own_tag--; | 371 | tipc_own_tag--; |
373 | } | 372 | } |