summaryrefslogtreecommitdiff
path: root/fs/aufs/wkq.h
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.h
parentc91265cd0efb83778f015b4d4b1129bd2cfd075e (diff)
Linux-libre 4.6.2-gnu
Diffstat (limited to 'fs/aufs/wkq.h')
-rw-r--r--fs/aufs/wkq.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/aufs/wkq.h b/fs/aufs/wkq.h
index f6c9b9902..752b9c52d 100644
--- a/fs/aufs/wkq.h
+++ b/fs/aufs/wkq.h
@@ -20,7 +20,7 @@ struct super_block;
* in the next operation, wait for the 'nowait' tasks in system-wide workqueue
*/
struct au_nowait_tasks {
- atomic_t nw_len;
+ struct percpu_counter nw_len;
wait_queue_head_t nw_wq;
};
@@ -47,6 +47,7 @@ int au_wkq_do_wait(unsigned int flags, au_wkq_func_t func, void *args);
int au_wkq_nowait(au_wkq_func_t func, void *args, struct super_block *sb,
unsigned int flags);
void au_nwt_init(struct au_nowait_tasks *nwt);
+void au_nwt_fin(struct au_nowait_tasks *nwt);
int __init au_wkq_init(void);
void au_wkq_fin(void);
@@ -64,13 +65,14 @@ static inline int au_wkq_wait(au_wkq_func_t func, void *args)
static inline void au_nwt_done(struct au_nowait_tasks *nwt)
{
- if (atomic_dec_and_test(&nwt->nw_len))
+ percpu_counter_dec(&nwt->nw_len);
+ if (!percpu_counter_sum(&nwt->nw_len))
wake_up_all(&nwt->nw_wq);
}
static inline int au_nwt_flush(struct au_nowait_tasks *nwt)
{
- wait_event(nwt->nw_wq, !atomic_read(&nwt->nw_len));
+ wait_event(nwt->nw_wq, !percpu_counter_sum(&nwt->nw_len));
return 0;
}