From 7683fdc1e88644ee8108a1f33faba80545f0024d Mon Sep 17 00:00:00 2001 From: Antonio Quartulli Date: Wed, 27 Apr 2011 14:28:07 +0200 Subject: 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 Acked-by: Simon Wunderlich Signed-off-by: Sven Eckelmann --- net/batman-adv/types.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'net/batman-adv/types.h') 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 */ }; -- cgit v1.2.3-59-g8ed1b