diff options
Diffstat (limited to 'fs/aufs/wkq.c')
-rw-r--r-- | fs/aufs/wkq.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/aufs/wkq.c b/fs/aufs/wkq.c index 0f1500e93..65c0137a5 100644 --- a/fs/aufs/wkq.c +++ b/fs/aufs/wkq.c @@ -145,7 +145,7 @@ int au_wkq_nowait(au_wkq_func_t func, void *args, struct super_block *sb, int err; struct au_wkinfo *wkinfo; - atomic_inc(&au_sbi(sb)->si_nowait.nw_len); + percpu_counter_inc(&au_sbi(sb)->si_nowait.nw_len); /* * wkq_func() must free this wkinfo. @@ -175,11 +175,16 @@ int au_wkq_nowait(au_wkq_func_t func, void *args, struct super_block *sb, void au_nwt_init(struct au_nowait_tasks *nwt) { - atomic_set(&nwt->nw_len, 0); - /* smp_mb(); */ /* atomic_set */ + percpu_counter_init(&nwt->nw_len, 0, GFP_NOFS); init_waitqueue_head(&nwt->nw_wq); } +void au_nwt_fin(struct au_nowait_tasks *nwt) +{ + AuDebugOn(percpu_counter_sum(&nwt->nw_len)); + percpu_counter_destroy(&nwt->nw_len); +} + void au_wkq_fin(void) { destroy_workqueue(au_wkq); |