aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-05-12 12:34:00 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-06-25 02:21:44 -0400
commit03fc7f863dc53516ca9764b324f54d10c4a137f6 (patch)
treedb546686461d215f3394cb23f4db26f6dba61767 /net/batman-adv
parentaf4447f62927accb68d5a074fabc539ef57b2729 (diff)
batman-adv: Prefix originator local static functions with batadv_
All non-static symbols of batman-adv were prefixed with batadv_ to avoid collisions with other symbols of the kernel. Other symbols of batman-adv should use the same prefix to keep the naming scheme consistent. Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/originator.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 1cd640e8dab9..bf9ec39a8349 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -28,17 +28,17 @@
28#include "soft-interface.h" 28#include "soft-interface.h"
29#include "bridge_loop_avoidance.h" 29#include "bridge_loop_avoidance.h"
30 30
31static void purge_orig(struct work_struct *work); 31static void batadv_purge_orig(struct work_struct *work);
32 32
33static void start_purge_timer(struct bat_priv *bat_priv) 33static void batadv_start_purge_timer(struct bat_priv *bat_priv)
34{ 34{
35 INIT_DELAYED_WORK(&bat_priv->orig_work, purge_orig); 35 INIT_DELAYED_WORK(&bat_priv->orig_work, batadv_purge_orig);
36 queue_delayed_work(batadv_event_workqueue, 36 queue_delayed_work(batadv_event_workqueue,
37 &bat_priv->orig_work, msecs_to_jiffies(1000)); 37 &bat_priv->orig_work, msecs_to_jiffies(1000));
38} 38}
39 39
40/* returns 1 if they are the same originator */ 40/* returns 1 if they are the same originator */
41static int compare_orig(const struct hlist_node *node, const void *data2) 41static int batadv_compare_orig(const struct hlist_node *node, const void *data2)
42{ 42{
43 const void *data1 = container_of(node, struct orig_node, hash_entry); 43 const void *data1 = container_of(node, struct orig_node, hash_entry);
44 44
@@ -55,7 +55,7 @@ int batadv_originator_init(struct bat_priv *bat_priv)
55 if (!bat_priv->orig_hash) 55 if (!bat_priv->orig_hash)
56 goto err; 56 goto err;
57 57
58 start_purge_timer(bat_priv); 58 batadv_start_purge_timer(bat_priv);
59 return 0; 59 return 0;
60 60
61err: 61err:
@@ -110,7 +110,7 @@ out:
110 return neigh_node; 110 return neigh_node;
111} 111}
112 112
113static void orig_node_free_rcu(struct rcu_head *rcu) 113static void batadv_orig_node_free_rcu(struct rcu_head *rcu)
114{ 114{
115 struct hlist_node *node, *node_tmp; 115 struct hlist_node *node, *node_tmp;
116 struct neigh_node *neigh_node, *tmp_neigh_node; 116 struct neigh_node *neigh_node, *tmp_neigh_node;
@@ -149,7 +149,7 @@ static void orig_node_free_rcu(struct rcu_head *rcu)
149void batadv_orig_node_free_ref(struct orig_node *orig_node) 149void batadv_orig_node_free_ref(struct orig_node *orig_node)
150{ 150{
151 if (atomic_dec_and_test(&orig_node->refcount)) 151 if (atomic_dec_and_test(&orig_node->refcount))
152 call_rcu(&orig_node->rcu, orig_node_free_rcu); 152 call_rcu(&orig_node->rcu, batadv_orig_node_free_rcu);
153} 153}
154 154
155void batadv_originator_free(struct bat_priv *bat_priv) 155void batadv_originator_free(struct bat_priv *bat_priv)
@@ -248,7 +248,7 @@ struct orig_node *batadv_get_orig_node(struct bat_priv *bat_priv,
248 if (!orig_node->bcast_own_sum) 248 if (!orig_node->bcast_own_sum)
249 goto free_bcast_own; 249 goto free_bcast_own;
250 250
251 hash_added = batadv_hash_add(bat_priv->orig_hash, compare_orig, 251 hash_added = batadv_hash_add(bat_priv->orig_hash, batadv_compare_orig,
252 batadv_choose_orig, orig_node, 252 batadv_choose_orig, orig_node,
253 &orig_node->hash_entry); 253 &orig_node->hash_entry);
254 if (hash_added != 0) 254 if (hash_added != 0)
@@ -264,9 +264,9 @@ free_orig_node:
264 return NULL; 264 return NULL;
265} 265}
266 266
267static bool purge_orig_neighbors(struct bat_priv *bat_priv, 267static bool batadv_purge_orig_neighbors(struct bat_priv *bat_priv,
268 struct orig_node *orig_node, 268 struct orig_node *orig_node,
269 struct neigh_node **best_neigh_node) 269 struct neigh_node **best_neigh_node)
270{ 270{
271 struct hlist_node *node, *node_tmp; 271 struct hlist_node *node, *node_tmp;
272 struct neigh_node *neigh_node; 272 struct neigh_node *neigh_node;
@@ -319,8 +319,8 @@ static bool purge_orig_neighbors(struct bat_priv *bat_priv,
319 return neigh_purged; 319 return neigh_purged;
320} 320}
321 321
322static bool purge_orig_node(struct bat_priv *bat_priv, 322static bool batadv_purge_orig_node(struct bat_priv *bat_priv,
323 struct orig_node *orig_node) 323 struct orig_node *orig_node)
324{ 324{
325 struct neigh_node *best_neigh_node; 325 struct neigh_node *best_neigh_node;
326 326
@@ -331,8 +331,8 @@ static bool purge_orig_node(struct bat_priv *bat_priv,
331 jiffies_to_msecs(orig_node->last_seen)); 331 jiffies_to_msecs(orig_node->last_seen));
332 return true; 332 return true;
333 } else { 333 } else {
334 if (purge_orig_neighbors(bat_priv, orig_node, 334 if (batadv_purge_orig_neighbors(bat_priv, orig_node,
335 &best_neigh_node)) 335 &best_neigh_node))
336 batadv_update_route(bat_priv, orig_node, 336 batadv_update_route(bat_priv, orig_node,
337 best_neigh_node); 337 best_neigh_node);
338 } 338 }
@@ -340,7 +340,7 @@ static bool purge_orig_node(struct bat_priv *bat_priv,
340 return false; 340 return false;
341} 341}
342 342
343static void _purge_orig(struct bat_priv *bat_priv) 343static void _batadv_purge_orig(struct bat_priv *bat_priv)
344{ 344{
345 struct hashtable_t *hash = bat_priv->orig_hash; 345 struct hashtable_t *hash = bat_priv->orig_hash;
346 struct hlist_node *node, *node_tmp; 346 struct hlist_node *node, *node_tmp;
@@ -360,7 +360,7 @@ static void _purge_orig(struct bat_priv *bat_priv)
360 spin_lock_bh(list_lock); 360 spin_lock_bh(list_lock);
361 hlist_for_each_entry_safe(orig_node, node, node_tmp, 361 hlist_for_each_entry_safe(orig_node, node, node_tmp,
362 head, hash_entry) { 362 head, hash_entry) {
363 if (purge_orig_node(bat_priv, orig_node)) { 363 if (batadv_purge_orig_node(bat_priv, orig_node)) {
364 if (orig_node->gw_flags) 364 if (orig_node->gw_flags)
365 batadv_gw_node_delete(bat_priv, 365 batadv_gw_node_delete(bat_priv,
366 orig_node); 366 orig_node);
@@ -380,20 +380,20 @@ static void _purge_orig(struct bat_priv *bat_priv)
380 batadv_gw_election(bat_priv); 380 batadv_gw_election(bat_priv);
381} 381}
382 382
383static void purge_orig(struct work_struct *work) 383static void batadv_purge_orig(struct work_struct *work)
384{ 384{
385 struct delayed_work *delayed_work = 385 struct delayed_work *delayed_work =
386 container_of(work, struct delayed_work, work); 386 container_of(work, struct delayed_work, work);
387 struct bat_priv *bat_priv = 387 struct bat_priv *bat_priv =
388 container_of(delayed_work, struct bat_priv, orig_work); 388 container_of(delayed_work, struct bat_priv, orig_work);
389 389
390 _purge_orig(bat_priv); 390 _batadv_purge_orig(bat_priv);
391 start_purge_timer(bat_priv); 391 batadv_start_purge_timer(bat_priv);
392} 392}
393 393
394void batadv_purge_orig_ref(struct bat_priv *bat_priv) 394void batadv_purge_orig_ref(struct bat_priv *bat_priv)
395{ 395{
396 _purge_orig(bat_priv); 396 _batadv_purge_orig(bat_priv);
397} 397}
398 398
399int batadv_orig_seq_print_text(struct seq_file *seq, void *offset) 399int batadv_orig_seq_print_text(struct seq_file *seq, void *offset)
@@ -483,7 +483,7 @@ out:
483 return ret; 483 return ret;
484} 484}
485 485
486static int orig_node_add_if(struct orig_node *orig_node, int max_if_num) 486static int batadv_orig_node_add_if(struct orig_node *orig_node, int max_if_num)
487{ 487{
488 void *data_ptr; 488 void *data_ptr;
489 489
@@ -528,7 +528,7 @@ int batadv_orig_hash_add_if(struct hard_iface *hard_iface, int max_if_num)
528 rcu_read_lock(); 528 rcu_read_lock();
529 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { 529 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) {
530 spin_lock_bh(&orig_node->ogm_cnt_lock); 530 spin_lock_bh(&orig_node->ogm_cnt_lock);
531 ret = orig_node_add_if(orig_node, max_if_num); 531 ret = batadv_orig_node_add_if(orig_node, max_if_num);
532 spin_unlock_bh(&orig_node->ogm_cnt_lock); 532 spin_unlock_bh(&orig_node->ogm_cnt_lock);
533 533
534 if (ret == -ENOMEM) 534 if (ret == -ENOMEM)
@@ -544,8 +544,8 @@ err:
544 return -ENOMEM; 544 return -ENOMEM;
545} 545}
546 546
547static int orig_node_del_if(struct orig_node *orig_node, 547static int batadv_orig_node_del_if(struct orig_node *orig_node,
548 int max_if_num, int del_if_num) 548 int max_if_num, int del_if_num)
549{ 549{
550 void *data_ptr = NULL; 550 void *data_ptr = NULL;
551 int chunk_size; 551 int chunk_size;
@@ -612,8 +612,8 @@ int batadv_orig_hash_del_if(struct hard_iface *hard_iface, int max_if_num)
612 rcu_read_lock(); 612 rcu_read_lock();
613 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) { 613 hlist_for_each_entry_rcu(orig_node, node, head, hash_entry) {
614 spin_lock_bh(&orig_node->ogm_cnt_lock); 614 spin_lock_bh(&orig_node->ogm_cnt_lock);
615 ret = orig_node_del_if(orig_node, max_if_num, 615 ret = batadv_orig_node_del_if(orig_node, max_if_num,
616 hard_iface->if_num); 616 hard_iface->if_num);
617 spin_unlock_bh(&orig_node->ogm_cnt_lock); 617 spin_unlock_bh(&orig_node->ogm_cnt_lock);
618 618
619 if (ret == -ENOMEM) 619 if (ret == -ENOMEM)