aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorMarek Lindner <lindner_marek@yahoo.de>2012-03-17 03:28:32 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-05-13 13:06:39 -0400
commite3b0d0dea6e044283dff1c0852b20c98eb41a7f1 (patch)
treef8eb34fdf9bdda7e286889305bc7e0047df241d0 /net
parent3275e7cc84fb0574e9662e8e74c3b1dab38f7143 (diff)
batman-adv: prepare lq_update_lock to be shared among different protocols
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/bat_iv_ogm.c9
-rw-r--r--net/batman-adv/originator.c1
-rw-r--r--net/batman-adv/types.h2
3 files changed, 6 insertions, 6 deletions
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index abd10c490fd9..dc53798ebb47 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -43,7 +43,6 @@ static struct neigh_node *bat_iv_ogm_neigh_new(struct hard_iface *hard_iface,
43 goto out; 43 goto out;
44 44
45 INIT_LIST_HEAD(&neigh_node->bonding_list); 45 INIT_LIST_HEAD(&neigh_node->bonding_list);
46 spin_lock_init(&neigh_node->tq_lock);
47 46
48 neigh_node->orig_node = orig_neigh; 47 neigh_node->orig_node = orig_neigh;
49 neigh_node->if_incoming = hard_iface; 48 neigh_node->if_incoming = hard_iface;
@@ -637,12 +636,12 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
637 if (is_duplicate) 636 if (is_duplicate)
638 continue; 637 continue;
639 638
640 spin_lock_bh(&tmp_neigh_node->tq_lock); 639 spin_lock_bh(&tmp_neigh_node->lq_update_lock);
641 ring_buffer_set(tmp_neigh_node->tq_recv, 640 ring_buffer_set(tmp_neigh_node->tq_recv,
642 &tmp_neigh_node->tq_index, 0); 641 &tmp_neigh_node->tq_index, 0);
643 tmp_neigh_node->tq_avg = 642 tmp_neigh_node->tq_avg =
644 ring_buffer_avg(tmp_neigh_node->tq_recv); 643 ring_buffer_avg(tmp_neigh_node->tq_recv);
645 spin_unlock_bh(&tmp_neigh_node->tq_lock); 644 spin_unlock_bh(&tmp_neigh_node->lq_update_lock);
646 } 645 }
647 646
648 if (!neigh_node) { 647 if (!neigh_node) {
@@ -668,12 +667,12 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
668 orig_node->flags = batman_ogm_packet->flags; 667 orig_node->flags = batman_ogm_packet->flags;
669 neigh_node->last_seen = jiffies; 668 neigh_node->last_seen = jiffies;
670 669
671 spin_lock_bh(&neigh_node->tq_lock); 670 spin_lock_bh(&neigh_node->lq_update_lock);
672 ring_buffer_set(neigh_node->tq_recv, 671 ring_buffer_set(neigh_node->tq_recv,
673 &neigh_node->tq_index, 672 &neigh_node->tq_index,
674 batman_ogm_packet->tq); 673 batman_ogm_packet->tq);
675 neigh_node->tq_avg = ring_buffer_avg(neigh_node->tq_recv); 674 neigh_node->tq_avg = ring_buffer_avg(neigh_node->tq_recv);
676 spin_unlock_bh(&neigh_node->tq_lock); 675 spin_unlock_bh(&neigh_node->lq_update_lock);
677 676
678 if (!is_duplicate) { 677 if (!is_duplicate) {
679 orig_node->last_ttl = batman_ogm_packet->header.ttl; 678 orig_node->last_ttl = batman_ogm_packet->header.ttl;
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index f4b62011ca3f..41147942ba53 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -99,6 +99,7 @@ struct neigh_node *batadv_neigh_node_new(struct hard_iface *hard_iface,
99 INIT_HLIST_NODE(&neigh_node->list); 99 INIT_HLIST_NODE(&neigh_node->list);
100 100
101 memcpy(neigh_node->addr, neigh_addr, ETH_ALEN); 101 memcpy(neigh_node->addr, neigh_addr, ETH_ALEN);
102 spin_lock_init(&neigh_node->lq_update_lock);
102 103
103 /* extra reference for return */ 104 /* extra reference for return */
104 atomic_set(&neigh_node->refcount, 2); 105 atomic_set(&neigh_node->refcount, 2);
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 66a3750aa9e7..61308e8016ff 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -137,7 +137,7 @@ struct neigh_node {
137 struct rcu_head rcu; 137 struct rcu_head rcu;
138 struct orig_node *orig_node; 138 struct orig_node *orig_node;
139 struct hard_iface *if_incoming; 139 struct hard_iface *if_incoming;
140 spinlock_t tq_lock; /* protects: tq_recv, tq_index */ 140 spinlock_t lq_update_lock; /* protects: tq_recv, tq_index */
141}; 141};
142 142
143#ifdef CONFIG_BATMAN_ADV_BLA 143#ifdef CONFIG_BATMAN_ADV_BLA