quota: code cleanup for hash bits calculation

Code cleanup for hash bits calculation by
calling ilog2().

Link: https://lore.kernel.org/r/20190923135223.27674-1-cgxu519@zoho.com.cn
Signed-off-by: Chengguang Xu <cgxu519@zoho.com.cn>
Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
Chengguang Xu 2019-09-23 21:52:23 +08:00 committed by Jan Kara
parent 05848db208
commit 24fc755f56
1 changed files with 1 additions and 5 deletions

View File

@ -2981,11 +2981,7 @@ static int __init dquot_init(void)
/* Find power-of-two hlist_heads which can fit into allocation */
nr_hash = (1UL << order) * PAGE_SIZE / sizeof(struct hlist_head);
dq_hash_bits = 0;
do {
dq_hash_bits++;
} while (nr_hash >> dq_hash_bits);
dq_hash_bits--;
dq_hash_bits = ilog2(nr_hash);
nr_hash = 1UL << dq_hash_bits;
dq_hash_mask = nr_hash - 1;