aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2011-02-25 10:01:58 -0500
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-03-13 16:35:17 -0400
commitd1bcb11544109114d72965afea7805cc3e16a83a (patch)
treeb530d264ec04c6ac8d61d2b9f44cf2ef07a66d86 /net/tipc/node.c
parent9df3b7eb6ec1c7734482f782bf8335a2737c02f0 (diff)
tipc: Split up unified structure of network-related variables
Converts the fields of the global "tipc_net" structure into individual variables. Since the struct was never referenced as a complete unit, its existence was pointless. This will facilitate upcoming changes to TIPC's node table and simpify upcoming relocation of the variables so they are only visible to the files that actually use them. This change is essentially cosmetic in nature, and doesn't affect the operation of TIPC. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r--net/tipc/node.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index a24fad32345e..64976f2e3c66 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -81,9 +81,9 @@ struct tipc_node *tipc_node_create(u32 addr)
81 INIT_LIST_HEAD(&n_ptr->nsub); 81 INIT_LIST_HEAD(&n_ptr->nsub);
82 82
83 n_num = tipc_node(addr); 83 n_num = tipc_node(addr);
84 tipc_net.nodes[n_num] = n_ptr; 84 tipc_nodes[n_num] = n_ptr;
85 if (n_num > tipc_net.highest_node) 85 if (n_num > tipc_highest_node)
86 tipc_net.highest_node = n_num; 86 tipc_highest_node = n_num;
87 87
88 spin_unlock_bh(&node_create_lock); 88 spin_unlock_bh(&node_create_lock);
89 return n_ptr; 89 return n_ptr;
@@ -97,11 +97,11 @@ void tipc_node_delete(struct tipc_node *n_ptr)
97 return; 97 return;
98 98
99 n_num = tipc_node(n_ptr->addr); 99 n_num = tipc_node(n_ptr->addr);
100 tipc_net.nodes[n_num] = NULL; 100 tipc_nodes[n_num] = NULL;
101 kfree(n_ptr); 101 kfree(n_ptr);
102 102
103 while (!tipc_net.nodes[tipc_net.highest_node]) 103 while (!tipc_nodes[tipc_highest_node])
104 if (--tipc_net.highest_node == 0) 104 if (--tipc_highest_node == 0)
105 break; 105 break;
106} 106}
107 107
@@ -233,7 +233,7 @@ struct tipc_node *tipc_node_attach_link(struct link *l_ptr)
233 233
234 if (!n_ptr->links[bearer_id]) { 234 if (!n_ptr->links[bearer_id]) {
235 n_ptr->links[bearer_id] = l_ptr; 235 n_ptr->links[bearer_id] = l_ptr;
236 atomic_inc(&tipc_net.links); 236 atomic_inc(&tipc_num_links);
237 n_ptr->link_cnt++; 237 n_ptr->link_cnt++;
238 return n_ptr; 238 return n_ptr;
239 } 239 }
@@ -247,7 +247,7 @@ struct tipc_node *tipc_node_attach_link(struct link *l_ptr)
247void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr) 247void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr)
248{ 248{
249 n_ptr->links[l_ptr->b_ptr->identity] = NULL; 249 n_ptr->links[l_ptr->b_ptr->identity] = NULL;
250 atomic_dec(&tipc_net.links); 250 atomic_dec(&tipc_num_links);
251 n_ptr->link_cnt--; 251 n_ptr->link_cnt--;
252} 252}
253 253
@@ -390,7 +390,7 @@ struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
390 " (network address)"); 390 " (network address)");
391 391
392 read_lock_bh(&tipc_net_lock); 392 read_lock_bh(&tipc_net_lock);
393 if (!tipc_net.nodes) { 393 if (!tipc_nodes) {
394 read_unlock_bh(&tipc_net_lock); 394 read_unlock_bh(&tipc_net_lock);
395 return tipc_cfg_reply_none(); 395 return tipc_cfg_reply_none();
396 } 396 }
@@ -398,7 +398,7 @@ struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
398 /* For now, get space for all other nodes */ 398 /* For now, get space for all other nodes */
399 399
400 payload_size = TLV_SPACE(sizeof(node_info)) * 400 payload_size = TLV_SPACE(sizeof(node_info)) *
401 (tipc_net.highest_node - 1); 401 (tipc_highest_node - 1);
402 if (payload_size > 32768u) { 402 if (payload_size > 32768u) {
403 read_unlock_bh(&tipc_net_lock); 403 read_unlock_bh(&tipc_net_lock);
404 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED 404 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
@@ -412,8 +412,8 @@ struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space)
412 412
413 /* Add TLVs for all nodes in scope */ 413 /* Add TLVs for all nodes in scope */
414 414
415 for (n_num = 1; n_num <= tipc_net.highest_node; n_num++) { 415 for (n_num = 1; n_num <= tipc_highest_node; n_num++) {
416 n_ptr = tipc_net.nodes[n_num]; 416 n_ptr = tipc_nodes[n_num];
417 if (!n_ptr || !tipc_in_scope(domain, n_ptr->addr)) 417 if (!n_ptr || !tipc_in_scope(domain, n_ptr->addr))
418 continue; 418 continue;
419 node_info.addr = htonl(n_ptr->addr); 419 node_info.addr = htonl(n_ptr->addr);
@@ -451,7 +451,7 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space)
451 /* Get space for all unicast links + multicast link */ 451 /* Get space for all unicast links + multicast link */
452 452
453 payload_size = TLV_SPACE(sizeof(link_info)) * 453 payload_size = TLV_SPACE(sizeof(link_info)) *
454 (atomic_read(&tipc_net.links) + 1); 454 (atomic_read(&tipc_num_links) + 1);
455 if (payload_size > 32768u) { 455 if (payload_size > 32768u) {
456 read_unlock_bh(&tipc_net_lock); 456 read_unlock_bh(&tipc_net_lock);
457 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED 457 return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED
@@ -472,10 +472,10 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space)
472 472
473 /* Add TLVs for any other links in scope */ 473 /* Add TLVs for any other links in scope */
474 474
475 for (n_num = 1; n_num <= tipc_net.highest_node; n_num++) { 475 for (n_num = 1; n_num <= tipc_highest_node; n_num++) {
476 u32 i; 476 u32 i;
477 477
478 n_ptr = tipc_net.nodes[n_num]; 478 n_ptr = tipc_nodes[n_num];
479 if (!n_ptr || !tipc_in_scope(domain, n_ptr->addr)) 479 if (!n_ptr || !tipc_in_scope(domain, n_ptr->addr))
480 continue; 480 continue;
481 tipc_node_lock(n_ptr); 481 tipc_node_lock(n_ptr);