aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-03-13 22:57:25 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-15 01:35:34 -0400
commitc4db8848af6af92f90462258603be844baeab44d (patch)
tree582bc65b98879f06bc3e9f28b9adefdc90314725 /include/linux
parent63d512d0cffcae40505d9448abd509972465e846 (diff)
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/linux')
-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 {
56 * @locks: Array of spinlocks protecting individual buckets 56 * @locks: Array of spinlocks protecting individual buckets
57 * @walkers: List of active walkers 57 * @walkers: List of active walkers
58 * @rcu: RCU structure for freeing the table 58 * @rcu: RCU structure for freeing the table
59 * @future_tbl: Table under construction during rehashing
59 * @buckets: size * hash buckets 60 * @buckets: size * hash buckets
60 */ 61 */
61struct bucket_table { 62struct bucket_table {
@@ -68,6 +69,8 @@ struct bucket_table {
68 struct list_head walkers; 69 struct list_head walkers;
69 struct rcu_head rcu; 70 struct rcu_head rcu;
70 71
72 struct bucket_table __rcu *future_tbl;
73
71 struct rhash_head __rcu *buckets[] ____cacheline_aligned_in_smp; 74 struct rhash_head __rcu *buckets[] ____cacheline_aligned_in_smp;
72}; 75};
73 76
@@ -105,7 +108,6 @@ struct rhashtable_params {
105/** 108/**
106 * struct rhashtable - Hash table handle 109 * struct rhashtable - Hash table handle
107 * @tbl: Bucket table 110 * @tbl: Bucket table
108 * @future_tbl: Table under construction during expansion/shrinking
109 * @nelems: Number of elements in table 111 * @nelems: Number of elements in table
110 * @p: Configuration parameters 112 * @p: Configuration parameters
111 * @run_work: Deferred worker to expand/shrink asynchronously 113 * @run_work: Deferred worker to expand/shrink asynchronously
@@ -114,7 +116,6 @@ struct rhashtable_params {
114 */ 116 */
115struct rhashtable { 117struct rhashtable {
116 struct bucket_table __rcu *tbl; 118 struct bucket_table __rcu *tbl;
117 struct bucket_table __rcu *future_tbl;
118 atomic_t nelems; 119 atomic_t nelems;
119 bool being_destroyed; 120 bool being_destroyed;
120 struct rhashtable_params p; 121 struct rhashtable_params p;