@@ -319,27 +319,18 @@ int tipc_node_is_up(struct tipc_node *n_ptr)
319319
320320void tipc_node_attach_link (struct tipc_node * n_ptr , struct tipc_link * l_ptr )
321321{
322- struct tipc_net * tn = net_generic (n_ptr -> net , tipc_net_id );
323-
324322 n_ptr -> links [l_ptr -> bearer_id ] = l_ptr ;
325- spin_lock_bh (& tn -> node_list_lock );
326- tn -> num_links ++ ;
327- spin_unlock_bh (& tn -> node_list_lock );
328323 n_ptr -> link_cnt ++ ;
329324}
330325
331326void tipc_node_detach_link (struct tipc_node * n_ptr , struct tipc_link * l_ptr )
332327{
333- struct tipc_net * tn = net_generic (n_ptr -> net , tipc_net_id );
334328 int i ;
335329
336330 for (i = 0 ; i < MAX_BEARERS ; i ++ ) {
337331 if (l_ptr != n_ptr -> links [i ])
338332 continue ;
339333 n_ptr -> links [i ] = NULL ;
340- spin_lock_bh (& tn -> node_list_lock );
341- tn -> num_links -- ;
342- spin_unlock_bh (& tn -> node_list_lock );
343334 n_ptr -> link_cnt -- ;
344335 }
345336}
@@ -467,70 +458,6 @@ struct sk_buff *tipc_node_get_nodes(struct net *net, const void *req_tlv_area,
467458 return buf ;
468459}
469460
470- struct sk_buff * tipc_node_get_links (struct net * net , const void * req_tlv_area ,
471- int req_tlv_space )
472- {
473- struct tipc_net * tn = net_generic (net , tipc_net_id );
474- u32 domain ;
475- struct sk_buff * buf ;
476- struct tipc_node * n_ptr ;
477- struct tipc_link_info link_info ;
478- u32 payload_size ;
479-
480- if (!TLV_CHECK (req_tlv_area , req_tlv_space , TIPC_TLV_NET_ADDR ))
481- return tipc_cfg_reply_error_string (TIPC_CFG_TLV_ERROR );
482-
483- domain = ntohl (* (__be32 * )TLV_DATA (req_tlv_area ));
484- if (!tipc_addr_domain_valid (domain ))
485- return tipc_cfg_reply_error_string (TIPC_CFG_INVALID_VALUE
486- " (network address)" );
487-
488- if (!tn -> own_addr )
489- return tipc_cfg_reply_none ();
490-
491- spin_lock_bh (& tn -> node_list_lock );
492- /* Get space for all unicast links + broadcast link */
493- payload_size = TLV_SPACE ((sizeof (link_info )) * (tn -> num_links + 1 ));
494- if (payload_size > 32768u ) {
495- spin_unlock_bh (& tn -> node_list_lock );
496- return tipc_cfg_reply_error_string (TIPC_CFG_NOT_SUPPORTED
497- " (too many links)" );
498- }
499- spin_unlock_bh (& tn -> node_list_lock );
500-
501- buf = tipc_cfg_reply_alloc (payload_size );
502- if (!buf )
503- return NULL ;
504-
505- /* Add TLV for broadcast link */
506- link_info .dest = htonl (tipc_cluster_mask (tn -> own_addr ));
507- link_info .up = htonl (1 );
508- strlcpy (link_info .str , tipc_bclink_name , TIPC_MAX_LINK_NAME );
509- tipc_cfg_append_tlv (buf , TIPC_TLV_LINK_INFO , & link_info , sizeof (link_info ));
510-
511- /* Add TLVs for any other links in scope */
512- rcu_read_lock ();
513- list_for_each_entry_rcu (n_ptr , & tn -> node_list , list ) {
514- u32 i ;
515-
516- if (!tipc_in_scope (domain , n_ptr -> addr ))
517- continue ;
518- tipc_node_lock (n_ptr );
519- for (i = 0 ; i < MAX_BEARERS ; i ++ ) {
520- if (!n_ptr -> links [i ])
521- continue ;
522- link_info .dest = htonl (n_ptr -> addr );
523- link_info .up = htonl (tipc_link_is_up (n_ptr -> links [i ]));
524- strcpy (link_info .str , n_ptr -> links [i ]-> name );
525- tipc_cfg_append_tlv (buf , TIPC_TLV_LINK_INFO ,
526- & link_info , sizeof (link_info ));
527- }
528- tipc_node_unlock (n_ptr );
529- }
530- rcu_read_unlock ();
531- return buf ;
532- }
533-
534461/**
535462 * tipc_node_get_linkname - get the name of a link
536463 *
0 commit comments