diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-05-12 00:09:34 (GMT) |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-20 20:15:23 (GMT) |
commit | 7d211efc5087bc8870fa3374da88b4bf8159e79b (patch) | |
tree | 1cd6c7b6543610f7e684ac20988735c7c6d1c8fa /net/batman-adv/originator.c | |
parent | 9039dc7e8a42864744665bf0905f48c2724f6e3e (diff) | |
download | linux-7d211efc5087bc8870fa3374da88b4bf8159e79b.tar.xz |
batman-adv: Prefix originator non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.
Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/originator.c')
-rw-r--r-- | net/batman-adv/originator.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index 410a197..9358513 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c @@ -47,7 +47,7 @@ static int compare_orig(const struct hlist_node *node, const void *data2) return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0); } -int originator_init(struct bat_priv *bat_priv) +int batadv_originator_init(struct bat_priv *bat_priv) { if (bat_priv->orig_hash) return 0; @@ -64,14 +64,14 @@ err: return -ENOMEM; } -void neigh_node_free_ref(struct neigh_node *neigh_node) +void batadv_neigh_node_free_ref(struct neigh_node *neigh_node) { if (atomic_dec_and_test(&neigh_node->refcount)) kfree_rcu(neigh_node, rcu); } /* increases the refcounter of a found router */ -struct neigh_node *orig_node_get_router(struct orig_node *orig_node) +struct neigh_node *batadv_orig_node_get_router(struct orig_node *orig_node) { struct neigh_node *router; @@ -126,14 +126,14 @@ static void orig_node_free_rcu(struct rcu_head *rcu) list_for_each_entry_safe(neigh_node, tmp_neigh_node, &orig_node->bond_list, bonding_list) { list_del_rcu(&neigh_node->bonding_list); - neigh_node_free_ref(neigh_node); + batadv_neigh_node_free_ref(neigh_node); } /* for all neighbors towards this originator ... */ hlist_for_each_entry_safe(neigh_node, node, node_tmp, &orig_node->neigh_list, list) { hlist_del_rcu(&neigh_node->list); - neigh_node_free_ref(neigh_node); + batadv_neigh_node_free_ref(neigh_node); } spin_unlock_bh(&orig_node->neigh_list_lock); @@ -148,13 +148,13 @@ static void orig_node_free_rcu(struct rcu_head *rcu) kfree(orig_node); } -void orig_node_free_ref(struct orig_node *orig_node) +void batadv_orig_node_free_ref(struct orig_node *orig_node) { if (atomic_dec_and_test(&orig_node->refcount)) call_rcu(&orig_node->rcu, orig_node_free_rcu); } -void originator_free(struct bat_priv *bat_priv) +void batadv_originator_free(struct bat_priv *bat_priv) { struct hashtable_t *hash = bat_priv->orig_hash; struct hlist_node *node, *node_tmp; @@ -179,7 +179,7 @@ void originator_free(struct bat_priv *bat_priv) head, hash_entry) { hlist_del_rcu(node); - orig_node_free_ref(orig_node); + batadv_orig_node_free_ref(orig_node); } spin_unlock_bh(list_lock); } @@ -189,7 +189,8 @@ void originator_free(struct bat_priv *bat_priv) /* this function finds or creates an originator entry for the given * address if it does not exits */ -struct orig_node *get_orig_node(struct bat_priv *bat_priv, const uint8_t *addr) +struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv, + const uint8_t *addr) { struct orig_node *orig_node; int size; @@ -307,7 +308,7 @@ static bool purge_orig_neighbors(struct bat_priv *bat_priv, hlist_del_rcu(&neigh_node->list); bonding_candidate_del(orig_node, neigh_node); - neigh_node_free_ref(neigh_node); + batadv_neigh_node_free_ref(neigh_node); } else { if ((!*best_neigh_node) || (neigh_node->tq_avg > (*best_neigh_node)->tq_avg)) @@ -364,7 +365,7 @@ static void _purge_orig(struct bat_priv *bat_priv) batadv_gw_node_delete(bat_priv, orig_node); hlist_del_rcu(node); - orig_node_free_ref(orig_node); + batadv_orig_node_free_ref(orig_node); continue; } @@ -390,12 +391,12 @@ static void purge_orig(struct work_struct *work) start_purge_timer(bat_priv); } -void purge_orig_ref(struct bat_priv *bat_priv) +void batadv_purge_orig_ref(struct bat_priv *bat_priv) { _purge_orig(bat_priv); } -int orig_seq_print_text(struct seq_file *seq, void *offset) +int batadv_orig_seq_print_text(struct seq_file *seq, void *offset) { struct net_device *net_dev = (struct net_device *)seq->private; struct bat_priv *bat_priv = netdev_priv(net_dev); @@ -439,7 +440,7 @@ int orig_seq_print_text(struct seq_file *seq, void *offset) rcu_read_lock(); hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { - neigh_node = orig_node_get_router(orig_node); + neigh_node = batadv_orig_node_get_router(orig_node); if (!neigh_node) continue; @@ -468,7 +469,7 @@ int orig_seq_print_text(struct seq_file *seq, void *offset) batman_count++; next: - neigh_node_free_ref(neigh_node); + batadv_neigh_node_free_ref(neigh_node); } rcu_read_unlock(); } @@ -508,7 +509,7 @@ static int orig_node_add_if(struct orig_node *orig_node, int max_if_num) return 0; } -int orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num) +int batadv_orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num) { struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); struct hashtable_t *hash = bat_priv->orig_hash; @@ -590,7 +591,7 @@ free_own_sum: return 0; } -int orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num) +int batadv_orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num) { struct bat_priv *bat_priv = netdev_priv(hard_iface->soft_iface); struct hashtable_t *hash = bat_priv->orig_hash; |