From patchwork Mon Feb 14 13:35:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 879 Return-Path: Received: from nm16-vm0.bullet.mail.ukl.yahoo.com (nm16-vm0.bullet.mail.ukl.yahoo.com [217.146.183.254]) by open-mesh.org (Postfix) with SMTP id 01501154209 for ; Mon, 14 Feb 2011 14:39:56 +0100 (CET) Received: from [217.146.183.181] by nm16.bullet.mail.ukl.yahoo.com with NNFMP; 14 Feb 2011 13:39:56 -0000 Received: from [77.238.184.68] by tm12.bullet.mail.ukl.yahoo.com with NNFMP; 14 Feb 2011 13:39:56 -0000 Received: from [127.0.0.1] by smtp137.mail.ukl.yahoo.com with NNFMP; 14 Feb 2011 13:39:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1297690796; bh=EmrXHll3aUWC4ApzHEYKhrhwqyNjH60TVfnZ8EDjAnE=; h=X-Yahoo-Newman-Id:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=hPbT9Lbjvt8vky/ze380iaK6AnV0IRxrV7Bw8pS24LfKRcxELRdeBwtc2xldZ5Vxw3jzquoRlX0POkGyhdKegVAYcb3aVfs1CMPdposUgiu4X+J4GkDffs3KhWV0kSGzSAq2uYXLPrIUZ/Nig28w0B35qEi4du1V0O5bexHkh5o= X-Yahoo-Newman-Id: 245959.94975.bm@smtp137.mail.ukl.yahoo.com Received: from localhost (lindner_marek@90.61.214.155 with plain) by smtp137.mail.ukl.yahoo.com with SMTP; 14 Feb 2011 13:39:52 +0000 GMT X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- X-YMail-OSG: wX1UEiMVM1lmKHtlxISndalZpMHdOopjCsc340SUWPYM9ke Y4rWj.YaBTrplRQ04yMrjJi.MD5OxCTAReCuFzHD21UjJPkFPGqFLul68a50 4t6dZi6Pq0dkX.c3CxO5loajyQMHaKxv_jsucbMGzjZMGMxPdC4CNhF5bAn7 r67e2_XmVYuZywhx.FNOM1eH1WgPEXT.a5fe1WaOSe9aK4A7eKpC17tYRgVK 4ATfRxI6NmkWFRLkzwF6dkezp6VKof2Xlj95fN3R_1pCgOjVYPylFgSkG9C2 uhN08BfDFdsrnzw-- X-Yahoo-Newman-Property: ymail-3 From: Marek Lindner To: b.a.t.m.a.n@lists.open-mesh.org Date: Mon, 14 Feb 2011 14:35:48 +0100 Message-Id: <1297690549-18508-1-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <201102141435.27624.lindner_marek@yahoo.de> References: <201102141435.27624.lindner_marek@yahoo.de> Cc: Marek Lindner Subject: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: rename global if_list to hardif_list X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2011 13:39:57 -0000 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 --- batman-adv/hard-interface.c | 28 ++++++++++++++-------------- batman-adv/main.c | 6 +++--- batman-adv/main.h | 2 +- batman-adv/originator.c | 2 +- batman-adv/routing.c | 2 +- batman-adv/send.c | 4 ++-- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/batman-adv/hard-interface.c b/batman-adv/hard-interface.c index de9bd36..4a2e6e3 100644 --- a/batman-adv/hard-interface.c +++ b/batman-adv/hard-interface.c @@ -31,8 +31,8 @@ #include -/* protect update critical side of if_list - but not the content */ -static DEFINE_SPINLOCK(if_list_lock); +/* protect update critical side of hardif_list - but not the content */ +static DEFINE_SPINLOCK(hardif_list_lock); 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) struct batman_if *batman_if; rcu_read_lock(); - list_for_each_entry_rcu(batman_if, &if_list, list) { + list_for_each_entry_rcu(batman_if, &hardif_list, list) { if (batman_if->net_dev == net_dev && atomic_inc_not_zero(&batman_if->refcount)) goto out; @@ -99,7 +99,7 @@ static struct batman_if *get_active_batman_if(struct net_device *soft_iface) struct batman_if *batman_if; rcu_read_lock(); - list_for_each_entry_rcu(batman_if, &if_list, list) { + list_for_each_entry_rcu(batman_if, &hardif_list, list) { if (batman_if->soft_iface != soft_iface) continue; @@ -179,7 +179,7 @@ static void check_known_mac_addr(struct net_device *net_dev) struct batman_if *batman_if; rcu_read_lock(); - list_for_each_entry_rcu(batman_if, &if_list, list) { + list_for_each_entry_rcu(batman_if, &hardif_list, list) { if ((batman_if->if_status != IF_ACTIVE) && (batman_if->if_status != IF_TO_BE_ACTIVATED)) continue; @@ -212,7 +212,7 @@ int hardif_min_mtu(struct net_device *soft_iface) goto out; rcu_read_lock(); - list_for_each_entry_rcu(batman_if, &if_list, list) { + list_for_each_entry_rcu(batman_if, &hardif_list, list) { if ((batman_if->if_status != IF_ACTIVE) && (batman_if->if_status != IF_TO_BE_ACTIVATED)) continue; @@ -449,9 +449,9 @@ static struct batman_if *hardif_add_interface(struct net_device *net_dev) check_known_mac_addr(batman_if->net_dev); - spin_lock(&if_list_lock); - list_add_tail_rcu(&batman_if->list, &if_list); - spin_unlock(&if_list_lock); + spin_lock(&hardif_list_lock); + list_add_tail_rcu(&batman_if->list, &hardif_list); + spin_unlock(&hardif_list_lock); return batman_if; @@ -484,12 +484,12 @@ void hardif_remove_interfaces(void) INIT_LIST_HEAD(&if_queue); - spin_lock(&if_list_lock); - list_for_each_entry_safe(batman_if, batman_if_tmp, &if_list, list) { + spin_lock(&hardif_list_lock); + list_for_each_entry_safe(batman_if, batman_if_tmp, &hardif_list, list) { list_del_rcu(&batman_if->list); list_add_tail(&batman_if->list, &if_queue); } - spin_unlock(&if_list_lock); + spin_unlock(&hardif_list_lock); rtnl_lock(); 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, hardif_deactivate_interface(batman_if); break; case NETDEV_UNREGISTER: - spin_lock(&if_list_lock); + spin_lock(&hardif_list_lock); list_del_rcu(&batman_if->list); - spin_unlock(&if_list_lock); + spin_unlock(&hardif_list_lock); hardif_remove_interface(batman_if); break; diff --git a/batman-adv/main.c b/batman-adv/main.c index 09c21f2..57aea9b 100644 --- a/batman-adv/main.c +++ b/batman-adv/main.c @@ -33,7 +33,7 @@ #include "vis.h" #include "hash.h" -struct list_head if_list; +struct list_head hardif_list; unsigned char broadcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; @@ -41,7 +41,7 @@ struct workqueue_struct *bat_event_workqueue; static int __init batman_init(void) { - INIT_LIST_HEAD(&if_list); + INIT_LIST_HEAD(&hardif_list); /* the name should not be longer than 10 chars - see * http://lwn.net/Articles/23634/ */ @@ -156,7 +156,7 @@ int is_my_mac(uint8_t *addr) struct batman_if *batman_if; rcu_read_lock(); - list_for_each_entry_rcu(batman_if, &if_list, list) { + list_for_each_entry_rcu(batman_if, &hardif_list, list) { if (batman_if->if_status != IF_ACTIVE) continue; diff --git a/batman-adv/main.h b/batman-adv/main.h index 57f0d24..a0059dd 100644 --- a/batman-adv/main.h +++ b/batman-adv/main.h @@ -124,7 +124,7 @@ #define REVISION_VERSION_STR " "REVISION_VERSION #endif -extern struct list_head if_list; +extern struct list_head hardif_list; extern unsigned char broadcast_addr[]; extern struct workqueue_struct *bat_event_workqueue; diff --git a/batman-adv/originator.c b/batman-adv/originator.c index c2017b2..f76d2f5 100644 --- a/batman-adv/originator.c +++ b/batman-adv/originator.c @@ -601,7 +601,7 @@ int orig_hash_del_if(struct batman_if *batman_if, int max_if_num) /* renumber remaining batman interfaces _inside_ of orig_hash_lock */ rcu_read_lock(); - list_for_each_entry_rcu(batman_if_tmp, &if_list, list) { + list_for_each_entry_rcu(batman_if_tmp, &hardif_list, list) { if (batman_if_tmp->if_status == IF_NOT_IN_USE) continue; diff --git a/batman-adv/routing.c b/batman-adv/routing.c index 3cfa2c7..21e93b3 100644 --- a/batman-adv/routing.c +++ b/batman-adv/routing.c @@ -643,7 +643,7 @@ void receive_bat_packet(struct ethhdr *ethhdr, has_directlink_flag); rcu_read_lock(); - list_for_each_entry_rcu(batman_if, &if_list, list) { + list_for_each_entry_rcu(batman_if, &hardif_list, list) { if (batman_if->if_status != IF_ACTIVE) continue; diff --git a/batman-adv/send.c b/batman-adv/send.c index f0232ad..c4f3e49 100644 --- a/batman-adv/send.c +++ b/batman-adv/send.c @@ -204,7 +204,7 @@ static void send_packet(struct forw_packet *forw_packet) /* broadcast on every interface */ rcu_read_lock(); - list_for_each_entry_rcu(batman_if, &if_list, list) { + list_for_each_entry_rcu(batman_if, &hardif_list, list) { if (batman_if->soft_iface != soft_iface) continue; @@ -461,7 +461,7 @@ static void send_outstanding_bcast_packet(struct work_struct *work) /* rebroadcast packet */ rcu_read_lock(); - list_for_each_entry_rcu(batman_if, &if_list, list) { + list_for_each_entry_rcu(batman_if, &hardif_list, list) { if (batman_if->soft_iface != soft_iface) continue;