summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/rhashtable.c2
-rw-r--r--lib/test_rhashtable.c2
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)
{
/* Expand table when exceeding 75% load */
return atomic_read(&ht->nelems) > (new_size / 4 * 3) &&
- (ht->p.max_shift && atomic_read(&ht->shift) < ht->p.max_shift);
+ (!ht->p.max_shift || atomic_read(&ht->shift) < ht->p.max_shift);
}
EXPORT_SYMBOL_GPL(rht_grow_above_75);
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)
.key_len = sizeof(int),
.hashfn = jhash,
.nulls_base = (3U << RHT_BASE_SHIFT),
- .grow_decision = rht_grow_above_75,
- .shrink_decision = rht_shrink_below_30,
};
int err;