Skip to content

Commit 5a6cb47

Browse files
Kefeng Wangjankara
authored andcommitted
fs: quota: use group allocation of per-cpu counters API
Use group allocation of per-cpu counters api to accelerate dquot_init() and simplify code. Signed-off-by: Kefeng Wang <[email protected]> Signed-off-by: Jan Kara <[email protected]> Message-Id: <[email protected]>
1 parent 4cece76 commit 5a6cb47

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

fs/quota/dquot.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3016,11 +3016,10 @@ static int __init dquot_init(void)
30163016
if (!dquot_hash)
30173017
panic("Cannot create dquot hash table");
30183018

3019-
for (i = 0; i < _DQST_DQSTAT_LAST; i++) {
3020-
ret = percpu_counter_init(&dqstats.counter[i], 0, GFP_KERNEL);
3021-
if (ret)
3022-
panic("Cannot create dquot stat counters");
3023-
}
3019+
ret = percpu_counter_init_many(dqstats.counter, 0, GFP_KERNEL,
3020+
_DQST_DQSTAT_LAST);
3021+
if (ret)
3022+
panic("Cannot create dquot stat counters");
30243023

30253024
/* Find power-of-two hlist_heads which can fit into allocation */
30263025
nr_hash = (1UL << order) * PAGE_SIZE / sizeof(struct hlist_head);

0 commit comments

Comments
 (0)