aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-03-19 20:02:01 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-03-19 20:02:01 -0400
commit10ce3cc919f50c2043b41ca968b43c26a3672600 (patch)
treeea409366a5208aced495bc0516a08b81fd43222e /net/tipc/node.c
parent24e3e5ae1e4c2a3a32f5b1f96b4e3fd721806acd (diff)
parent5c6a7a62c130afef3d61c1dee153012231ff5cd9 (diff)
Merge branch 'next' into for-linus
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r--net/tipc/node.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 27b4bb0cca6c..6b226faad89f 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -136,9 +136,9 @@ void tipc_node_delete(struct tipc_node *n_ptr)
136 * Link becomes active (alone or shared) or standby, depending on its priority. 136 * Link becomes active (alone or shared) or standby, depending on its priority.
137 */ 137 */
138 138
139void tipc_node_link_up(struct tipc_node *n_ptr, struct link *l_ptr) 139void tipc_node_link_up(struct tipc_node *n_ptr, struct tipc_link *l_ptr)
140{ 140{
141 struct link **active = &n_ptr->active_links[0]; 141 struct tipc_link **active = &n_ptr->active_links[0];
142 142
143 n_ptr->working_links++; 143 n_ptr->working_links++;
144 144
@@ -171,14 +171,14 @@ void tipc_node_link_up(struct tipc_node *n_ptr, struct link *l_ptr)
171 171
172static void node_select_active_links(struct tipc_node *n_ptr) 172static void node_select_active_links(struct tipc_node *n_ptr)
173{ 173{
174 struct link **active = &n_ptr->active_links[0]; 174 struct tipc_link **active = &n_ptr->active_links[0];
175 u32 i; 175 u32 i;
176 u32 highest_prio = 0; 176 u32 highest_prio = 0;
177 177
178 active[0] = active[1] = NULL; 178 active[0] = active[1] = NULL;
179 179
180 for (i = 0; i < MAX_BEARERS; i++) { 180 for (i = 0; i < MAX_BEARERS; i++) {
181 struct link *l_ptr = n_ptr->links[i]; 181 struct tipc_link *l_ptr = n_ptr->links[i];
182 182
183 if (!l_ptr || !tipc_link_is_up(l_ptr) || 183 if (!l_ptr || !tipc_link_is_up(l_ptr) ||
184 (l_ptr->priority < highest_prio)) 184 (l_ptr->priority < highest_prio))
@@ -197,9 +197,9 @@ static void node_select_active_links(struct tipc_node *n_ptr)
197 * tipc_node_link_down - handle loss of link 197 * tipc_node_link_down - handle loss of link
198 */ 198 */
199 199
200void tipc_node_link_down(struct tipc_node *n_ptr, struct link *l_ptr) 200void tipc_node_link_down(struct tipc_node *n_ptr, struct tipc_link *l_ptr)
201{ 201{
202 struct link **active; 202 struct tipc_link **active;
203 203
204 n_ptr->working_links--; 204 n_ptr->working_links--;
205 205
@@ -239,14 +239,14 @@ int tipc_node_is_up(struct tipc_node *n_ptr)
239 return tipc_node_active_links(n_ptr); 239 return tipc_node_active_links(n_ptr);
240} 240}
241 241
242void tipc_node_attach_link(struct tipc_node *n_ptr, struct link *l_ptr) 242void tipc_node_attach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr)
243{ 243{
244 n_ptr->links[l_ptr->b_ptr->identity] = l_ptr; 244 n_ptr->links[l_ptr->b_ptr->identity] = l_ptr;
245 atomic_inc(&tipc_num_links); 245 atomic_inc(&tipc_num_links);
246 n_ptr->link_cnt++; 246 n_ptr->link_cnt++;
247} 247}
248 248
249void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr) 249void tipc_node_detach_link(struct tipc_node *n_ptr, struct tipc_link *l_ptr)
250{ 250{
251 n_ptr->links[l_ptr->b_ptr->identity] = NULL; 251 n_ptr->links[l_ptr->b_ptr->identity] = NULL;
252 atomic_dec(&tipc_num_links); 252 atomic_dec(&tipc_num_links);
@@ -307,7 +307,7 @@ static void node_established_contact(struct tipc_node *n_ptr)
307 n_ptr->bclink.acked = tipc_bclink_get_last_sent(); 307 n_ptr->bclink.acked = tipc_bclink_get_last_sent();
308 308
309 if (n_ptr->bclink.supported) { 309 if (n_ptr->bclink.supported) {
310 tipc_nmap_add(&tipc_bcast_nmap, n_ptr->addr); 310 tipc_bclink_add_node(n_ptr->addr);
311 if (n_ptr->addr < tipc_own_addr) 311 if (n_ptr->addr < tipc_own_addr)
312 tipc_own_tag++; 312 tipc_own_tag++;
313 } 313 }
@@ -350,9 +350,8 @@ static void node_lost_contact(struct tipc_node *n_ptr)
350 n_ptr->bclink.defragm = NULL; 350 n_ptr->bclink.defragm = NULL;
351 } 351 }
352 352
353 tipc_nmap_remove(&tipc_bcast_nmap, n_ptr->addr); 353 tipc_bclink_remove_node(n_ptr->addr);
354 tipc_bclink_acknowledge(n_ptr, 354 tipc_bclink_acknowledge(n_ptr, INVALID_LINK_SEQ);
355 mod(n_ptr->bclink.acked + 10000));
356 if (n_ptr->addr < tipc_own_addr) 355 if (n_ptr->addr < tipc_own_addr)
357 tipc_own_tag--; 356 tipc_own_tag--;
358 357
@@ -361,7 +360,7 @@ static void node_lost_contact(struct tipc_node *n_ptr)
361 360
362 /* Abort link changeover */ 361 /* Abort link changeover */
363 for (i = 0; i < MAX_BEARERS; i++) { 362 for (i = 0; i < MAX_BEARERS; i++) {
364 struct link *l_ptr = n_ptr->links[i]; 363 struct tipc_link *l_ptr = n_ptr->links[i];
365 if (!l_ptr) 364 if (!l_ptr)
366 continue; 365 continue;
367 l_ptr->reset_checkpoint = l_ptr->next_in_no; 366 l_ptr->reset_checkpoint = l_ptr->next_in_no;