diff options
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r-- | net/tipc/node.c | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index 46b87f77d342..ddaa2bbaa35d 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -120,7 +120,6 @@ struct tipc_node *tipc_node_create(struct net *net, u32 addr) | |||
120 | list_add_tail_rcu(&n_ptr->list, &temp_node->list); | 120 | list_add_tail_rcu(&n_ptr->list, &temp_node->list); |
121 | n_ptr->action_flags = TIPC_WAIT_PEER_LINKS_DOWN; | 121 | n_ptr->action_flags = TIPC_WAIT_PEER_LINKS_DOWN; |
122 | n_ptr->signature = INVALID_NODE_SIG; | 122 | n_ptr->signature = INVALID_NODE_SIG; |
123 | tn->num_nodes++; | ||
124 | exit: | 123 | exit: |
125 | spin_unlock_bh(&tn->node_list_lock); | 124 | spin_unlock_bh(&tn->node_list_lock); |
126 | return n_ptr; | 125 | return n_ptr; |
@@ -131,8 +130,6 @@ static void tipc_node_delete(struct tipc_net *tn, struct tipc_node *n_ptr) | |||
131 | list_del_rcu(&n_ptr->list); | 130 | list_del_rcu(&n_ptr->list); |
132 | hlist_del_rcu(&n_ptr->hash); | 131 | hlist_del_rcu(&n_ptr->hash); |
133 | kfree_rcu(n_ptr, rcu); | 132 | kfree_rcu(n_ptr, rcu); |
134 | |||
135 | tn->num_nodes--; | ||
136 | } | 133 | } |
137 | 134 | ||
138 | void tipc_node_stop(struct net *net) | 135 | void tipc_node_stop(struct net *net) |
@@ -407,57 +404,6 @@ static void node_lost_contact(struct tipc_node *n_ptr) | |||
407 | } | 404 | } |
408 | } | 405 | } |
409 | 406 | ||
410 | struct sk_buff *tipc_node_get_nodes(struct net *net, const void *req_tlv_area, | ||
411 | int req_tlv_space) | ||
412 | { | ||
413 | struct tipc_net *tn = net_generic(net, tipc_net_id); | ||
414 | u32 domain; | ||
415 | struct sk_buff *buf; | ||
416 | struct tipc_node *n_ptr; | ||
417 | struct tipc_node_info node_info; | ||
418 | u32 payload_size; | ||
419 | |||
420 | if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_NET_ADDR)) | ||
421 | return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); | ||
422 | |||
423 | domain = ntohl(*(__be32 *)TLV_DATA(req_tlv_area)); | ||
424 | if (!tipc_addr_domain_valid(domain)) | ||
425 | return tipc_cfg_reply_error_string(TIPC_CFG_INVALID_VALUE | ||
426 | " (network address)"); | ||
427 | |||
428 | spin_lock_bh(&tn->node_list_lock); | ||
429 | if (!tn->num_nodes) { | ||
430 | spin_unlock_bh(&tn->node_list_lock); | ||
431 | return tipc_cfg_reply_none(); | ||
432 | } | ||
433 | |||
434 | /* For now, get space for all other nodes */ | ||
435 | payload_size = TLV_SPACE(sizeof(node_info)) * tn->num_nodes; | ||
436 | if (payload_size > 32768u) { | ||
437 | spin_unlock_bh(&tn->node_list_lock); | ||
438 | return tipc_cfg_reply_error_string(TIPC_CFG_NOT_SUPPORTED | ||
439 | " (too many nodes)"); | ||
440 | } | ||
441 | spin_unlock_bh(&tn->node_list_lock); | ||
442 | |||
443 | buf = tipc_cfg_reply_alloc(payload_size); | ||
444 | if (!buf) | ||
445 | return NULL; | ||
446 | |||
447 | /* Add TLVs for all nodes in scope */ | ||
448 | rcu_read_lock(); | ||
449 | list_for_each_entry_rcu(n_ptr, &tn->node_list, list) { | ||
450 | if (!tipc_in_scope(domain, n_ptr->addr)) | ||
451 | continue; | ||
452 | node_info.addr = htonl(n_ptr->addr); | ||
453 | node_info.up = htonl(tipc_node_is_up(n_ptr)); | ||
454 | tipc_cfg_append_tlv(buf, TIPC_TLV_NODE_INFO, | ||
455 | &node_info, sizeof(node_info)); | ||
456 | } | ||
457 | rcu_read_unlock(); | ||
458 | return buf; | ||
459 | } | ||
460 | |||
461 | /** | 407 | /** |
462 | * tipc_node_get_linkname - get the name of a link | 408 | * tipc_node_get_linkname - get the name of a link |
463 | * | 409 | * |