diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-05-27 10:17:21 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-05-27 10:17:21 +0300 |
commit | 8d12ded3dd499e38e8022fe3ec53920d085e57a3 (patch) | |
tree | 8b73e5a68f24b0bd33430bed8993de979825ffcf /net/mac80211/sta_info.c | |
parent | d499c106843afa0703a68c64662bf42a16421aec (diff) | |
parent | 68ab747604da98f0a0414f197f346ac22888fcee (diff) | |
download | linux-8d12ded3dd499e38e8022fe3ec53920d085e57a3.tar.xz |
Merge branch 'perf/urgent' into perf/core, before applying dependent patches
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r-- | net/mac80211/sta_info.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 12971b71d0fa..2880f2ae99ab 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -66,6 +66,7 @@ static const struct rhashtable_params sta_rht_params = { .nelem_hint = 3, /* start small */ + .automatic_shrinking = true, .head_offset = offsetof(struct sta_info, hash_node), .key_offset = offsetof(struct sta_info, sta.addr), .key_len = ETH_ALEN, @@ -157,8 +158,24 @@ struct sta_info *sta_info_get(struct ieee80211_sub_if_data *sdata, const u8 *addr) { struct ieee80211_local *local = sdata->local; + struct sta_info *sta; + struct rhash_head *tmp; + const struct bucket_table *tbl; + + rcu_read_lock(); + tbl = rht_dereference_rcu(local->sta_hash.tbl, &local->sta_hash); - return rhashtable_lookup_fast(&local->sta_hash, addr, sta_rht_params); + for_each_sta_info(local, tbl, addr, sta, tmp) { + if (sta->sdata == sdata) { + rcu_read_unlock(); + /* this is safe as the caller must already hold + * another rcu read section or the mutex + */ + return sta; + } + } + rcu_read_unlock(); + return NULL; } /* |