aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rhashtable.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-03-09 18:27:55 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-11 16:28:25 -0400
commit988dfbd795cf08b00576c1ced4210281b2bccffc (patch)
tree535e1fbd7224c49386a5de1a8afc16948078489e /include/linux/rhashtable.h
parent0ddcf43d5d4a03ded1ee3f6b3b72a0cbed4e90b1 (diff)
rhashtable: Move hash_rnd into bucket_table
Currently hash_rnd is a parameter that users can set. However, no existing users set this parameter. It is also something that people are unlikely to want to set directly since it's just a random number. In preparation for allowing the reseeding/rehashing of rhashtable, this patch moves hash_rnd into bucket_table so that it's now an internal state rather than a parameter. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/rhashtable.h')
-rw-r--r--include/linux/rhashtable.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/rhashtable.h b/include/linux/rhashtable.h
index d438eeb08bff..5ef8ea551556 100644
--- a/include/linux/rhashtable.h
+++ b/include/linux/rhashtable.h
@@ -49,12 +49,14 @@ struct rhash_head {
49/** 49/**
50 * struct bucket_table - Table of hash buckets 50 * struct bucket_table - Table of hash buckets
51 * @size: Number of hash buckets 51 * @size: Number of hash buckets
52 * @hash_rnd: Random seed to fold into hash
52 * @locks_mask: Mask to apply before accessing locks[] 53 * @locks_mask: Mask to apply before accessing locks[]
53 * @locks: Array of spinlocks protecting individual buckets 54 * @locks: Array of spinlocks protecting individual buckets
54 * @buckets: size * hash buckets 55 * @buckets: size * hash buckets
55 */ 56 */
56struct bucket_table { 57struct bucket_table {
57 size_t size; 58 size_t size;
59 u32 hash_rnd;
58 unsigned int locks_mask; 60 unsigned int locks_mask;
59 spinlock_t *locks; 61 spinlock_t *locks;
60 62
@@ -72,7 +74,6 @@ struct rhashtable;
72 * @key_len: Length of key 74 * @key_len: Length of key
73 * @key_offset: Offset of key in struct to be hashed 75 * @key_offset: Offset of key in struct to be hashed
74 * @head_offset: Offset of rhash_head in struct to be hashed 76 * @head_offset: Offset of rhash_head in struct to be hashed
75 * @hash_rnd: Seed to use while hashing
76 * @max_shift: Maximum number of shifts while expanding 77 * @max_shift: Maximum number of shifts while expanding
77 * @min_shift: Minimum number of shifts while shrinking 78 * @min_shift: Minimum number of shifts while shrinking
78 * @nulls_base: Base value to generate nulls marker 79 * @nulls_base: Base value to generate nulls marker
@@ -85,7 +86,6 @@ struct rhashtable_params {
85 size_t key_len; 86 size_t key_len;
86 size_t key_offset; 87 size_t key_offset;
87 size_t head_offset; 88 size_t head_offset;
88 u32 hash_rnd;
89 size_t max_shift; 89 size_t max_shift;
90 size_t min_shift; 90 size_t min_shift;
91 u32 nulls_base; 91 u32 nulls_base;