summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-03-18 12:01:21 +0300
committerDavid S. Miller <davem@davemloft.net>2015-03-18 19:46:41 +0300
commite2e21c1c5808e5dfd88d3606cd6386cf85f6f5b1 (patch)
tree9509ed7547a4788e818c3038f7ce38a8856cf1ef /lib
parent4f509df4f50e72cba65c3b58241a17639b2d9b49 (diff)
downloadlinux-e2e21c1c5808e5dfd88d3606cd6386cf85f6f5b1.tar.xz
rhashtable: Remove max_shift and min_shift
Now that nobody uses max_shift and min_shift, we can safely remove them. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/rhashtable.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index c4061bbd0113..5f8fe3e88219 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -188,7 +188,6 @@ static bool rht_grow_above_75(const struct rhashtable *ht,
{
/* Expand table when exceeding 75% load */
return atomic_read(&ht->nelems) > (tbl->size / 4 * 3) &&
- (!ht->p.max_shift || tbl->size < (1 << ht->p.max_shift)) &&
(!ht->p.max_size || tbl->size < ht->p.max_size);
}
@@ -202,7 +201,6 @@ static bool rht_shrink_below_30(const struct rhashtable *ht,
{
/* Shrink table beneath 30% load */
return atomic_read(&ht->nelems) < (tbl->size * 3 / 10) &&
- tbl->size > (1 << ht->p.min_shift) &&
tbl->size > ht->p.min_size;
}
@@ -875,8 +873,7 @@ EXPORT_SYMBOL_GPL(rhashtable_walk_stop);
static size_t rounded_hashtable_size(struct rhashtable_params *params)
{
return max(roundup_pow_of_two(params->nelem_hint * 4 / 3),
- max(1UL << params->min_shift,
- (unsigned long)params->min_size));
+ (unsigned long)params->min_size);
}
/**
@@ -936,8 +933,6 @@ int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params)
if (params->nulls_base && params->nulls_base < (1U << RHT_BASE_SHIFT))
return -EINVAL;
- params->min_shift = max_t(size_t, params->min_shift,
- ilog2(HASH_MIN_SIZE));
params->min_size = max(params->min_size, HASH_MIN_SIZE);
if (params->nelem_hint)