diff options
-rw-r--r-- | lib/rhashtable.c | 2 | ||||
-rw-r--r-- | lib/test_rhashtable.c | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index e3a04e4b3ec5..bcf119bfdef4 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c | |||
@@ -251,7 +251,7 @@ bool rht_grow_above_75(const struct rhashtable *ht, size_t new_size) | |||
251 | { | 251 | { |
252 | /* Expand table when exceeding 75% load */ | 252 | /* Expand table when exceeding 75% load */ |
253 | return atomic_read(&ht->nelems) > (new_size / 4 * 3) && | 253 | return atomic_read(&ht->nelems) > (new_size / 4 * 3) && |
254 | (ht->p.max_shift && atomic_read(&ht->shift) < ht->p.max_shift); | 254 | (!ht->p.max_shift || atomic_read(&ht->shift) < ht->p.max_shift); |
255 | } | 255 | } |
256 | EXPORT_SYMBOL_GPL(rht_grow_above_75); | 256 | EXPORT_SYMBOL_GPL(rht_grow_above_75); |
257 | 257 | ||
diff --git a/lib/test_rhashtable.c b/lib/test_rhashtable.c index 58b995323c44..f9e9d734446a 100644 --- a/lib/test_rhashtable.c +++ b/lib/test_rhashtable.c | |||
@@ -202,8 +202,6 @@ static int __init test_rht_init(void) | |||
202 | .key_len = sizeof(int), | 202 | .key_len = sizeof(int), |
203 | .hashfn = jhash, | 203 | .hashfn = jhash, |
204 | .nulls_base = (3U << RHT_BASE_SHIFT), | 204 | .nulls_base = (3U << RHT_BASE_SHIFT), |
205 | .grow_decision = rht_grow_above_75, | ||
206 | .shrink_decision = rht_shrink_below_30, | ||
207 | }; | 205 | }; |
208 | int err; | 206 | int err; |
209 | 207 | ||