aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-03-14 13:57:25 +1100
committerDavid S. Miller <davem@davemloft.net>2015-03-15 01:35:34 -0400
commitc4db8848af6af92f90462258603be844baeab44d (patch)
tree582bc65b98879f06bc3e9f28b9adefdc90314725 /include
parentrhashtable: Add rehash counter to bucket_table (diff)
downloadlinux-dev-c4db8848af6af92f90462258603be844baeab44d.tar.xz
linux-dev-c4db8848af6af92f90462258603be844baeab44d.zip
rhashtable: Move future_tbl into struct bucket_table
This patch moves future_tbl to open up the possibility of having multiple rehashes on the same table. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/rhashtable.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h
index ed7562ad4ca0..1695378b3c5b 100644
--- a/include/linux/rhashtable.h
+++ b/include/linux/rhashtable.h
@@ -56,6 +56,7 @@ struct rhash_head {
* @locks: Array of spinlocks protecting individual buckets
* @walkers: List of active walkers
* @rcu: RCU structure for freeing the table
+ * @future_tbl: Table under construction during rehashing
* @buckets: size * hash buckets
*/
struct bucket_table {
@@ -68,6 +69,8 @@ struct bucket_table {
struct list_head walkers;
struct rcu_head rcu;
+ struct bucket_table __rcu *future_tbl;
+
struct rhash_head __rcu *buckets[] ____cacheline_aligned_in_smp;
};
@@ -105,7 +108,6 @@ struct rhashtable_params {
/**
* struct rhashtable - Hash table handle
* @tbl: Bucket table
- * @future_tbl: Table under construction during expansion/shrinking
* @nelems: Number of elements in table
* @p: Configuration parameters
* @run_work: Deferred worker to expand/shrink asynchronously
@@ -114,7 +116,6 @@ struct rhashtable_params {
*/
struct rhashtable {
struct bucket_table __rcu *tbl;
- struct bucket_table __rcu *future_tbl;
atomic_t nelems;
bool being_destroyed;
struct rhashtable_params p;