Searched refs:nc_node (Results 1 - 1 of 1) sorted by relevance

/linux-4.1.27/net/batman-adv/
H A Dnetwork-coding.c178 * batadv_nc_node_release - release nc_node from lists and queue for free after
180 * @nc_node: the nc node to free
182 static void batadv_nc_node_release(struct batadv_nc_node *nc_node) batadv_nc_node_release() argument
184 batadv_orig_node_free_ref(nc_node->orig_node); batadv_nc_node_release()
185 kfree_rcu(nc_node, rcu); batadv_nc_node_release()
191 * @nc_node: the nc node to free
193 static void batadv_nc_node_free_ref(struct batadv_nc_node *nc_node) batadv_nc_node_free_ref() argument
195 if (atomic_dec_and_test(&nc_node->refcount)) batadv_nc_node_free_ref()
196 batadv_nc_node_release(nc_node); batadv_nc_node_free_ref()
226 * @nc_node: the nc node to check
231 struct batadv_nc_node *nc_node) batadv_nc_to_purge_nc_node()
236 return batadv_has_timed_out(nc_node->last_seen, BATADV_NC_NODE_TIMEOUT); batadv_nc_to_purge_nc_node()
297 struct batadv_nc_node *nc_node, *nc_node_tmp; batadv_nc_purge_orig_nc_nodes() local
299 /* For each nc_node in list */ batadv_nc_purge_orig_nc_nodes()
301 list_for_each_entry_safe(nc_node, nc_node_tmp, list, list) { list_for_each_entry_safe()
305 if (to_purge && !to_purge(bat_priv, nc_node)) list_for_each_entry_safe()
309 "Removing nc_node %pM -> %pM\n", list_for_each_entry_safe()
310 nc_node->addr, nc_node->orig_node->orig); list_for_each_entry_safe()
311 list_del_rcu(&nc_node->list); list_for_each_entry_safe()
312 batadv_nc_node_free_ref(nc_node); list_for_each_entry_safe()
332 /* Check ingoing nc_node's of this orig_node */ batadv_nc_purge_orig()
337 /* Check outgoing nc_node's of this orig_node */ batadv_nc_purge_orig()
751 * Returns the nc_node if found, NULL otherwise.
758 struct batadv_nc_node *nc_node, *nc_node_out = NULL; batadv_nc_find_nc_node() local
768 list_for_each_entry_rcu(nc_node, list, list) { list_for_each_entry_rcu()
769 if (!batadv_compare_eth(nc_node->addr, orig_node->orig)) list_for_each_entry_rcu()
772 if (!atomic_inc_not_zero(&nc_node->refcount)) list_for_each_entry_rcu()
776 nc_node_out = nc_node; list_for_each_entry_rcu()
793 * Returns the nc_node if found or created, NULL in case of an error.
801 struct batadv_nc_node *nc_node; batadv_nc_get_nc_node() local
805 /* Check if nc_node is already added */ batadv_nc_get_nc_node()
806 nc_node = batadv_nc_find_nc_node(orig_node, orig_neigh_node, in_coding); batadv_nc_get_nc_node()
809 if (nc_node) batadv_nc_get_nc_node()
810 return nc_node; batadv_nc_get_nc_node()
812 nc_node = kzalloc(sizeof(*nc_node), GFP_ATOMIC); batadv_nc_get_nc_node()
813 if (!nc_node) batadv_nc_get_nc_node()
819 /* Initialize nc_node */ batadv_nc_get_nc_node()
820 INIT_LIST_HEAD(&nc_node->list); batadv_nc_get_nc_node()
821 ether_addr_copy(nc_node->addr, orig_node->orig); batadv_nc_get_nc_node()
822 nc_node->orig_node = orig_neigh_node; batadv_nc_get_nc_node()
823 atomic_set(&nc_node->refcount, 2); batadv_nc_get_nc_node()
834 batadv_dbg(BATADV_DBG_NC, bat_priv, "Adding nc_node %pM -> %pM\n", batadv_nc_get_nc_node()
835 nc_node->addr, nc_node->orig_node->orig); batadv_nc_get_nc_node()
837 /* Add nc_node to orig_node */ batadv_nc_get_nc_node()
839 list_add_tail_rcu(&nc_node->list, list); batadv_nc_get_nc_node()
842 return nc_node; batadv_nc_get_nc_node()
845 kfree(nc_node); batadv_nc_get_nc_node()
1385 struct batadv_nc_node *nc_node; batadv_nc_skb_dst_search() local
1389 list_for_each_entry_rcu(nc_node, &orig_node->in_coding_list, list) { batadv_nc_skb_dst_search()
1393 ethhdr->h_source, nc_node); batadv_nc_skb_dst_search()
1853 struct batadv_nc_node *nc_node; batadv_nc_nodes_seq_print_text() local
1878 list_for_each_entry_rcu(nc_node, hlist_for_each_entry_rcu()
1882 nc_node->addr); hlist_for_each_entry_rcu()
1887 list_for_each_entry_rcu(nc_node, hlist_for_each_entry_rcu()
1891 nc_node->addr); hlist_for_each_entry_rcu()
230 batadv_nc_to_purge_nc_node(struct batadv_priv *bat_priv, struct batadv_nc_node *nc_node) batadv_nc_to_purge_nc_node() argument

Completed in 65 milliseconds