aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-03-15 01:35:46 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-15 01:35:46 -0400
commit5a2f78dd51d9d71aa40cb752af88332f45c884b7 (patch)
tree582bc65b98879f06bc3e9f28b9adefdc90314725 /include
parentnet: dsa: do not use slave MII bus for fixed PHYs (diff)
parentrhashtable: Move future_tbl into struct bucket_table (diff)
downloadlinux-dev-5a2f78dd51d9d71aa40cb752af88332f45c884b7.tar.xz
linux-dev-5a2f78dd51d9d71aa40cb752af88332f45c884b7.zip
Merge branch 'rhashtable-next'
Herbert Xu says: ==================== rhashtable: Fixes + cleanups + preparation for multiple rehash Patch 1 fixes the walker so that it behaves properly even during a resize. Patch 2-3 are cleanups. Patch 4-6 lays some ground work for the upcoming multiple rehashing. This revision fixes the warning coming from the bucket_table->size downsize and improves its changelog. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/rhashtable.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h
index c93ff8ac474a..1695378b3c5b 100644
--- a/include/linux/rhashtable.h
+++ b/include/linux/rhashtable.h
@@ -49,18 +49,27 @@ struct rhash_head {
/**
* struct bucket_table - Table of hash buckets
* @size: Number of hash buckets
+ * @rehash: Current bucket being rehashed
* @hash_rnd: Random seed to fold into hash
* @shift: Current size (1 << shift)
* @locks_mask: Mask to apply before accessing locks[]
* @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 {
- size_t size;
+ unsigned int size;
+ unsigned int rehash;
u32 hash_rnd;
u32 shift;
unsigned int locks_mask;
spinlock_t *locks;
+ struct list_head walkers;
+ struct rcu_head rcu;
+
+ struct bucket_table __rcu *future_tbl;
struct rhash_head __rcu *buckets[] ____cacheline_aligned_in_smp;
};
@@ -99,33 +108,29 @@ 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
* @mutex: Mutex to protect current/future table swapping
- * @walkers: List of active walkers
* @being_destroyed: True if table is set up for destruction
*/
struct rhashtable {
struct bucket_table __rcu *tbl;
- struct bucket_table __rcu *future_tbl;
atomic_t nelems;
bool being_destroyed;
struct rhashtable_params p;
struct work_struct run_work;
struct mutex mutex;
- struct list_head walkers;
};
/**
* struct rhashtable_walker - Hash table walker
* @list: List entry on list of walkers
- * @resize: Resize event occured
+ * @tbl: The table that we were walking over
*/
struct rhashtable_walker {
struct list_head list;
- bool resize;
+ struct bucket_table *tbl;
};
/**