diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2011-02-18 07:33:19 -0500 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2011-03-05 06:52:05 -0500 |
commit | 4389e47af856635eb17d03b2572a50576c12db24 (patch) | |
tree | 988fbbd883f5c8691d2bf100656e723e54073c0a /net/batman-adv | |
parent | d0072609baebaffb522083d367f4f195187f60f8 (diff) |
batman-adv: rename global if_list to hardif_list
Batman-adv works with "hard interfaces" as well as "soft interfaces".
The new name should better make clear which kind of interfaces this
list stores.
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/hard-interface.c | 28 | ||||
-rw-r--r-- | net/batman-adv/main.c | 6 | ||||
-rw-r--r-- | net/batman-adv/main.h | 2 | ||||
-rw-r--r-- | net/batman-adv/originator.c | 2 | ||||
-rw-r--r-- | net/batman-adv/routing.c | 2 | ||||
-rw-r--r-- | net/batman-adv/send.c | 4 |
6 files changed, 22 insertions, 22 deletions
diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index de9bd36e00dc..4a2e6e33ebc0 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c | |||
@@ -31,8 +31,8 @@ | |||
31 | 31 | ||
32 | #include <linux/if_arp.h> | 32 | #include <linux/if_arp.h> |
33 | 33 | ||
34 | /* protect update critical side of if_list - but not the content */ | 34 | /* protect update critical side of hardif_list - but not the content */ |
35 | static DEFINE_SPINLOCK(if_list_lock); | 35 | static DEFINE_SPINLOCK(hardif_list_lock); |
36 | 36 | ||
37 | 37 | ||
38 | static int batman_skb_recv(struct sk_buff *skb, | 38 | static int batman_skb_recv(struct sk_buff *skb, |
@@ -54,7 +54,7 @@ struct batman_if *get_batman_if_by_netdev(struct net_device *net_dev) | |||
54 | struct batman_if *batman_if; | 54 | struct batman_if *batman_if; |
55 | 55 | ||
56 | rcu_read_lock(); | 56 | rcu_read_lock(); |
57 | list_for_each_entry_rcu(batman_if, &if_list, list) { | 57 | list_for_each_entry_rcu(batman_if, &hardif_list, list) { |
58 | if (batman_if->net_dev == net_dev && | 58 | if (batman_if->net_dev == net_dev && |
59 | atomic_inc_not_zero(&batman_if->refcount)) | 59 | atomic_inc_not_zero(&batman_if->refcount)) |
60 | goto out; | 60 | goto out; |
@@ -99,7 +99,7 @@ static struct batman_if *get_active_batman_if(struct net_device *soft_iface) | |||
99 | struct batman_if *batman_if; | 99 | struct batman_if *batman_if; |
100 | 100 | ||
101 | rcu_read_lock(); | 101 | rcu_read_lock(); |
102 | list_for_each_entry_rcu(batman_if, &if_list, list) { | 102 | list_for_each_entry_rcu(batman_if, &hardif_list, list) { |
103 | if (batman_if->soft_iface != soft_iface) | 103 | if (batman_if->soft_iface != soft_iface) |
104 | continue; | 104 | continue; |
105 | 105 | ||
@@ -179,7 +179,7 @@ static void check_known_mac_addr(struct net_device *net_dev) | |||
179 | struct batman_if *batman_if; | 179 | struct batman_if *batman_if; |
180 | 180 | ||
181 | rcu_read_lock(); | 181 | rcu_read_lock(); |
182 | list_for_each_entry_rcu(batman_if, &if_list, list) { | 182 | list_for_each_entry_rcu(batman_if, &hardif_list, list) { |
183 | if ((batman_if->if_status != IF_ACTIVE) && | 183 | if ((batman_if->if_status != IF_ACTIVE) && |
184 | (batman_if->if_status != IF_TO_BE_ACTIVATED)) | 184 | (batman_if->if_status != IF_TO_BE_ACTIVATED)) |
185 | continue; | 185 | continue; |
@@ -212,7 +212,7 @@ int hardif_min_mtu(struct net_device *soft_iface) | |||
212 | goto out; | 212 | goto out; |
213 | 213 | ||
214 | rcu_read_lock(); | 214 | rcu_read_lock(); |
215 | list_for_each_entry_rcu(batman_if, &if_list, list) { | 215 | list_for_each_entry_rcu(batman_if, &hardif_list, list) { |
216 | if ((batman_if->if_status != IF_ACTIVE) && | 216 | if ((batman_if->if_status != IF_ACTIVE) && |
217 | (batman_if->if_status != IF_TO_BE_ACTIVATED)) | 217 | (batman_if->if_status != IF_TO_BE_ACTIVATED)) |
218 | continue; | 218 | continue; |
@@ -449,9 +449,9 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev) | |||
449 | 449 | ||
450 | check_known_mac_addr(batman_if->net_dev); | 450 | check_known_mac_addr(batman_if->net_dev); |
451 | 451 | ||
452 | spin_lock(&if_list_lock); | 452 | spin_lock(&hardif_list_lock); |
453 | list_add_tail_rcu(&batman_if->list, &if_list); | 453 | list_add_tail_rcu(&batman_if->list, &hardif_list); |
454 | spin_unlock(&if_list_lock); | 454 | spin_unlock(&hardif_list_lock); |
455 | 455 | ||
456 | return batman_if; | 456 | return batman_if; |
457 | 457 | ||
@@ -484,12 +484,12 @@ void hardif_remove_interfaces(void) | |||
484 | 484 | ||
485 | INIT_LIST_HEAD(&if_queue); | 485 | INIT_LIST_HEAD(&if_queue); |
486 | 486 | ||
487 | spin_lock(&if_list_lock); | 487 | spin_lock(&hardif_list_lock); |
488 | list_for_each_entry_safe(batman_if, batman_if_tmp, &if_list, list) { | 488 | list_for_each_entry_safe(batman_if, batman_if_tmp, &hardif_list, list) { |
489 | list_del_rcu(&batman_if->list); | 489 | list_del_rcu(&batman_if->list); |
490 | list_add_tail(&batman_if->list, &if_queue); | 490 | list_add_tail(&batman_if->list, &if_queue); |
491 | } | 491 | } |
492 | spin_unlock(&if_list_lock); | 492 | spin_unlock(&hardif_list_lock); |
493 | 493 | ||
494 | rtnl_lock(); | 494 | rtnl_lock(); |
495 | list_for_each_entry_safe(batman_if, batman_if_tmp, &if_queue, list) { | 495 | list_for_each_entry_safe(batman_if, batman_if_tmp, &if_queue, list) { |
@@ -520,9 +520,9 @@ static int hard_if_event(struct notifier_block *this, | |||
520 | hardif_deactivate_interface(batman_if); | 520 | hardif_deactivate_interface(batman_if); |
521 | break; | 521 | break; |
522 | case NETDEV_UNREGISTER: | 522 | case NETDEV_UNREGISTER: |
523 | spin_lock(&if_list_lock); | 523 | spin_lock(&hardif_list_lock); |
524 | list_del_rcu(&batman_if->list); | 524 | list_del_rcu(&batman_if->list); |
525 | spin_unlock(&if_list_lock); | 525 | spin_unlock(&hardif_list_lock); |
526 | 526 | ||
527 | hardif_remove_interface(batman_if); | 527 | hardif_remove_interface(batman_if); |
528 | break; | 528 | break; |
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index 09c21f26156c..57aea9bcdb33 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include "vis.h" | 33 | #include "vis.h" |
34 | #include "hash.h" | 34 | #include "hash.h" |
35 | 35 | ||
36 | struct list_head if_list; | 36 | struct list_head hardif_list; |
37 | 37 | ||
38 | unsigned char broadcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; | 38 | unsigned char broadcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; |
39 | 39 | ||
@@ -41,7 +41,7 @@ struct workqueue_struct *bat_event_workqueue; | |||
41 | 41 | ||
42 | static int __init batman_init(void) | 42 | static int __init batman_init(void) |
43 | { | 43 | { |
44 | INIT_LIST_HEAD(&if_list); | 44 | INIT_LIST_HEAD(&hardif_list); |
45 | 45 | ||
46 | /* the name should not be longer than 10 chars - see | 46 | /* the name should not be longer than 10 chars - see |
47 | * http://lwn.net/Articles/23634/ */ | 47 | * http://lwn.net/Articles/23634/ */ |
@@ -156,7 +156,7 @@ int is_my_mac(uint8_t *addr) | |||
156 | struct batman_if *batman_if; | 156 | struct batman_if *batman_if; |
157 | 157 | ||
158 | rcu_read_lock(); | 158 | rcu_read_lock(); |
159 | list_for_each_entry_rcu(batman_if, &if_list, list) { | 159 | list_for_each_entry_rcu(batman_if, &hardif_list, list) { |
160 | if (batman_if->if_status != IF_ACTIVE) | 160 | if (batman_if->if_status != IF_ACTIVE) |
161 | continue; | 161 | continue; |
162 | 162 | ||
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h index 06b5b994cc20..dc248697de71 100644 --- a/net/batman-adv/main.h +++ b/net/batman-adv/main.h | |||
@@ -122,7 +122,7 @@ | |||
122 | #define REVISION_VERSION_STR " "REVISION_VERSION | 122 | #define REVISION_VERSION_STR " "REVISION_VERSION |
123 | #endif | 123 | #endif |
124 | 124 | ||
125 | extern struct list_head if_list; | 125 | extern struct list_head hardif_list; |
126 | 126 | ||
127 | extern unsigned char broadcast_addr[]; | 127 | extern unsigned char broadcast_addr[]; |
128 | extern struct workqueue_struct *bat_event_workqueue; | 128 | extern struct workqueue_struct *bat_event_workqueue; |
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c index a8d0262e9d90..84ef9ae6c770 100644 --- a/net/batman-adv/originator.c +++ b/net/batman-adv/originator.c | |||
@@ -602,7 +602,7 @@ int orig_hash_del_if(struct batman_if *batman_if, int max_if_num) | |||
602 | 602 | ||
603 | /* renumber remaining batman interfaces _inside_ of orig_hash_lock */ | 603 | /* renumber remaining batman interfaces _inside_ of orig_hash_lock */ |
604 | rcu_read_lock(); | 604 | rcu_read_lock(); |
605 | list_for_each_entry_rcu(batman_if_tmp, &if_list, list) { | 605 | list_for_each_entry_rcu(batman_if_tmp, &hardif_list, list) { |
606 | if (batman_if_tmp->if_status == IF_NOT_IN_USE) | 606 | if (batman_if_tmp->if_status == IF_NOT_IN_USE) |
607 | continue; | 607 | continue; |
608 | 608 | ||
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 3cfa2c74c94f..21e93b39b2a4 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -643,7 +643,7 @@ void receive_bat_packet(struct ethhdr *ethhdr, | |||
643 | has_directlink_flag); | 643 | has_directlink_flag); |
644 | 644 | ||
645 | rcu_read_lock(); | 645 | rcu_read_lock(); |
646 | list_for_each_entry_rcu(batman_if, &if_list, list) { | 646 | list_for_each_entry_rcu(batman_if, &hardif_list, list) { |
647 | if (batman_if->if_status != IF_ACTIVE) | 647 | if (batman_if->if_status != IF_ACTIVE) |
648 | continue; | 648 | continue; |
649 | 649 | ||
diff --git a/net/batman-adv/send.c b/net/batman-adv/send.c index f0232ad77222..c4f3e4988b63 100644 --- a/net/batman-adv/send.c +++ b/net/batman-adv/send.c | |||
@@ -204,7 +204,7 @@ static void send_packet(struct forw_packet *forw_packet) | |||
204 | 204 | ||
205 | /* broadcast on every interface */ | 205 | /* broadcast on every interface */ |
206 | rcu_read_lock(); | 206 | rcu_read_lock(); |
207 | list_for_each_entry_rcu(batman_if, &if_list, list) { | 207 | list_for_each_entry_rcu(batman_if, &hardif_list, list) { |
208 | if (batman_if->soft_iface != soft_iface) | 208 | if (batman_if->soft_iface != soft_iface) |
209 | continue; | 209 | continue; |
210 | 210 | ||
@@ -461,7 +461,7 @@ static void send_outstanding_bcast_packet(struct work_struct *work) | |||
461 | 461 | ||
462 | /* rebroadcast packet */ | 462 | /* rebroadcast packet */ |
463 | rcu_read_lock(); | 463 | rcu_read_lock(); |
464 | list_for_each_entry_rcu(batman_if, &if_list, list) { | 464 | list_for_each_entry_rcu(batman_if, &hardif_list, list) { |
465 | if (batman_if->soft_iface != soft_iface) | 465 | if (batman_if->soft_iface != soft_iface) |
466 | continue; | 466 | continue; |
467 | 467 | ||