diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2011-01-19 15:01:44 -0500 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2011-03-05 06:52:04 -0500 |
commit | d0072609baebaffb522083d367f4f195187f60f8 (patch) | |
tree | 44e014264e2a2815d63f09c6ba9283d2866cbf48 /net/batman-adv/originator.c | |
parent | 1605d0d60b66b9461cfcff86f8cfc80964f23430 (diff) |
batman-adv: remove orig_hash spinlock
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/originator.c')
-rw-r--r-- | net/batman-adv/originator.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index 69e27a243fd0..a8d0262e9d90 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c | |||
@@ -44,18 +44,15 @@ int originator_init(struct bat_priv *bat_priv) | |||
44 | if (bat_priv->orig_hash) | 44 | if (bat_priv->orig_hash) |
45 | return 1; | 45 | return 1; |
46 | 46 | ||
47 | spin_lock_bh(&bat_priv->orig_hash_lock); | ||
48 | bat_priv->orig_hash = hash_new(1024); | 47 | bat_priv->orig_hash = hash_new(1024); |
49 | 48 | ||
50 | if (!bat_priv->orig_hash) | 49 | if (!bat_priv->orig_hash) |
51 | goto err; | 50 | goto err; |
52 | 51 | ||
53 | spin_unlock_bh(&bat_priv->orig_hash_lock); | ||
54 | start_purge_timer(bat_priv); | 52 | start_purge_timer(bat_priv); |
55 | return 1; | 53 | return 1; |
56 | 54 | ||
57 | err: | 55 | err: |
58 | spin_unlock_bh(&bat_priv->orig_hash_lock); | ||
59 | return 0; | 56 | return 0; |
60 | } | 57 | } |
61 | 58 | ||
@@ -159,7 +156,6 @@ void originator_free(struct bat_priv *bat_priv) | |||
159 | 156 | ||
160 | cancel_delayed_work_sync(&bat_priv->orig_work); | 157 | cancel_delayed_work_sync(&bat_priv->orig_work); |
161 | 158 | ||
162 | spin_lock_bh(&bat_priv->orig_hash_lock); | ||
163 | bat_priv->orig_hash = NULL; | 159 | bat_priv->orig_hash = NULL; |
164 | 160 | ||
165 | for (i = 0; i < hash->size; i++) { | 161 | for (i = 0; i < hash->size; i++) { |
@@ -177,7 +173,6 @@ void originator_free(struct bat_priv *bat_priv) | |||
177 | } | 173 | } |
178 | 174 | ||
179 | hash_destroy(hash); | 175 | hash_destroy(hash); |
180 | spin_unlock_bh(&bat_priv->orig_hash_lock); | ||
181 | } | 176 | } |
182 | 177 | ||
183 | /* this function finds or creates an originator entry for the given | 178 | /* this function finds or creates an originator entry for the given |
@@ -342,8 +337,6 @@ static void _purge_orig(struct bat_priv *bat_priv) | |||
342 | if (!hash) | 337 | if (!hash) |
343 | return; | 338 | return; |
344 | 339 | ||
345 | spin_lock_bh(&bat_priv->orig_hash_lock); | ||
346 | |||
347 | /* for all origins... */ | 340 | /* for all origins... */ |
348 | for (i = 0; i < hash->size; i++) { | 341 | for (i = 0; i < hash->size; i++) { |
349 | head = &hash->table[i]; | 342 | head = &hash->table[i]; |
@@ -367,8 +360,6 @@ static void _purge_orig(struct bat_priv *bat_priv) | |||
367 | spin_unlock_bh(list_lock); | 360 | spin_unlock_bh(list_lock); |
368 | } | 361 | } |
369 | 362 | ||
370 | spin_unlock_bh(&bat_priv->orig_hash_lock); | ||
371 | |||
372 | gw_node_purge(bat_priv); | 363 | gw_node_purge(bat_priv); |
373 | gw_election(bat_priv); | 364 | gw_election(bat_priv); |
374 | 365 | ||
@@ -425,8 +416,6 @@ int orig_seq_print_text(struct seq_file *seq, void *offset) | |||
425 | "Originator", "last-seen", "#", TQ_MAX_VALUE, "Nexthop", | 416 | "Originator", "last-seen", "#", TQ_MAX_VALUE, "Nexthop", |
426 | "outgoingIF", "Potential nexthops"); | 417 | "outgoingIF", "Potential nexthops"); |
427 | 418 | ||
428 | spin_lock_bh(&bat_priv->orig_hash_lock); | ||
429 | |||
430 | for (i = 0; i < hash->size; i++) { | 419 | for (i = 0; i < hash->size; i++) { |
431 | head = &hash->table[i]; | 420 | head = &hash->table[i]; |
432 | 421 | ||
@@ -462,8 +451,6 @@ int orig_seq_print_text(struct seq_file *seq, void *offset) | |||
462 | rcu_read_unlock(); | 451 | rcu_read_unlock(); |
463 | } | 452 | } |
464 | 453 | ||
465 | spin_unlock_bh(&bat_priv->orig_hash_lock); | ||
466 | |||
467 | if ((batman_count == 0)) | 454 | if ((batman_count == 0)) |
468 | seq_printf(seq, "No batman nodes in range ...\n"); | 455 | seq_printf(seq, "No batman nodes in range ...\n"); |
469 | 456 | ||
@@ -511,8 +498,6 @@ int orig_hash_add_if(struct batman_if *batman_if, int max_if_num) | |||
511 | 498 | ||
512 | /* resize all orig nodes because orig_node->bcast_own(_sum) depend on | 499 | /* resize all orig nodes because orig_node->bcast_own(_sum) depend on |
513 | * if_num */ | 500 | * if_num */ |
514 | spin_lock_bh(&bat_priv->orig_hash_lock); | ||
515 | |||
516 | for (i = 0; i < hash->size; i++) { | 501 | for (i = 0; i < hash->size; i++) { |
517 | head = &hash->table[i]; | 502 | head = &hash->table[i]; |
518 | 503 | ||
@@ -528,12 +513,10 @@ int orig_hash_add_if(struct batman_if *batman_if, int max_if_num) | |||
528 | rcu_read_unlock(); | 513 | rcu_read_unlock(); |
529 | } | 514 | } |
530 | 515 | ||
531 | spin_unlock_bh(&bat_priv->orig_hash_lock); | ||
532 | return 0; | 516 | return 0; |
533 | 517 | ||
534 | err: | 518 | err: |
535 | rcu_read_unlock(); | 519 | rcu_read_unlock(); |
536 | spin_unlock_bh(&bat_priv->orig_hash_lock); | ||
537 | return -ENOMEM; | 520 | return -ENOMEM; |
538 | } | 521 | } |
539 | 522 | ||
@@ -601,8 +584,6 @@ int orig_hash_del_if(struct batman_if *batman_if, int max_if_num) | |||
601 | 584 | ||
602 | /* resize all orig nodes because orig_node->bcast_own(_sum) depend on | 585 | /* resize all orig nodes because orig_node->bcast_own(_sum) depend on |
603 | * if_num */ | 586 | * if_num */ |
604 | spin_lock_bh(&bat_priv->orig_hash_lock); | ||
605 | |||
606 | for (i = 0; i < hash->size; i++) { | 587 | for (i = 0; i < hash->size; i++) { |
607 | head = &hash->table[i]; | 588 | head = &hash->table[i]; |
608 | 589 | ||
@@ -637,11 +618,9 @@ int orig_hash_del_if(struct batman_if *batman_if, int max_if_num) | |||
637 | rcu_read_unlock(); | 618 | rcu_read_unlock(); |
638 | 619 | ||
639 | batman_if->if_num = -1; | 620 | batman_if->if_num = -1; |
640 | spin_unlock_bh(&bat_priv->orig_hash_lock); | ||
641 | return 0; | 621 | return 0; |
642 | 622 | ||
643 | err: | 623 | err: |
644 | rcu_read_unlock(); | 624 | rcu_read_unlock(); |
645 | spin_unlock_bh(&bat_priv->orig_hash_lock); | ||
646 | return -ENOMEM; | 625 | return -ENOMEM; |
647 | } | 626 | } |