mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
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>
This commit is contained in:
parent
63d512d0cf
commit
c4db8848af
2 changed files with 14 additions and 18 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue