aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/types.h
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2011-04-27 14:28:07 +0200
committerSven Eckelmann <sven@narfation.org>2011-06-20 11:37:30 +0200
commit7683fdc1e88644ee8108a1f33faba80545f0024d (patch)
tree6a06c51fc2344e1f88e31591f978f3944cfe230e /net/batman-adv/types.h
parentbatman-adv: improved roaming mechanism (diff)
downloadlinux-dev-7683fdc1e88644ee8108a1f33faba80545f0024d.tar.xz
linux-dev-7683fdc1e88644ee8108a1f33faba80545f0024d.zip
batman-adv: protect the local and the global trans-tables with rcu
The local and the global translation-tables are now lock free and rcu protected. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to '')
-rw-r--r--net/batman-adv/types.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 9c84fa9f0968..11e8569a8ca7 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -184,8 +184,6 @@ struct bat_priv {
spinlock_t forw_bat_list_lock; /* protects forw_bat_list */
spinlock_t forw_bcast_list_lock; /* protects */
spinlock_t tt_changes_list_lock; /* protects tt_changes */
- spinlock_t tt_lhash_lock; /* protects tt_local_hash */
- spinlock_t tt_ghash_lock; /* protects tt_global_hash */
spinlock_t tt_req_list_lock; /* protects tt_req_list */
spinlock_t tt_roam_list_lock; /* protects tt_roam_list */
spinlock_t gw_list_lock; /* protects gw_list and curr_gw */
@@ -226,6 +224,8 @@ struct tt_local_entry {
uint8_t addr[ETH_ALEN];
unsigned long last_seen;
char never_purge;
+ atomic_t refcount;
+ struct rcu_head rcu;
struct hlist_node hash_entry;
};
@@ -235,6 +235,8 @@ struct tt_global_entry {
uint8_t ttvn;
uint8_t flags; /* only TT_GLOBAL_ROAM is used */
unsigned long roam_at; /* time at which TT_GLOBAL_ROAM was set */
+ atomic_t refcount;
+ struct rcu_head rcu;
struct hlist_node hash_entry; /* entry in the global table */
};