summaryrefslogtreecommitdiff
path: root/fs/aufs/wkq.c
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-06-10 05:30:17 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-06-10 05:30:17 -0300
commitd635711daa98be86d4c7fd01499c34f566b54ccb (patch)
treeaa5cc3760a27c3d57146498cb82fa549547de06c /fs/aufs/wkq.c
parentc91265cd0efb83778f015b4d4b1129bd2cfd075e (diff)
Linux-libre 4.6.2-gnu
Diffstat (limited to 'fs/aufs/wkq.c')
-rw-r--r--fs/aufs/wkq.c11
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);