diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-09-11 04:34:46 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-09-11 04:34:46 -0300 |
commit | 863981e96738983919de841ec669e157e6bdaeb0 (patch) | |
tree | d6d89a12e7eb8017837c057935a2271290907f76 /fs/aufs/wkq.h | |
parent | 8dec7c70575785729a6a9e6719a955e9c545bcab (diff) |
Linux-libre 4.7.1-gnupck-4.7.1-gnu
Diffstat (limited to 'fs/aufs/wkq.h')
-rw-r--r-- | fs/aufs/wkq.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/aufs/wkq.h b/fs/aufs/wkq.h index 752b9c52d..6d63f7464 100644 --- a/fs/aufs/wkq.h +++ b/fs/aufs/wkq.h @@ -12,6 +12,8 @@ #ifdef __KERNEL__ +#include <linux/percpu_counter.h> + struct super_block; /* ---------------------------------------------------------------------- */ @@ -20,7 +22,7 @@ struct super_block; * in the next operation, wait for the 'nowait' tasks in system-wide workqueue */ struct au_nowait_tasks { - struct percpu_counter nw_len; + atomic_t nw_len; wait_queue_head_t nw_wq; }; @@ -47,7 +49,6 @@ 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); @@ -65,14 +66,13 @@ static inline int au_wkq_wait(au_wkq_func_t func, void *args) static inline void au_nwt_done(struct au_nowait_tasks *nwt) { - percpu_counter_dec(&nwt->nw_len); - if (!percpu_counter_sum(&nwt->nw_len)) + if (atomic_dec_and_test(&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, !percpu_counter_sum(&nwt->nw_len)); + wait_event(nwt->nw_wq, !atomic_read(&nwt->nw_len)); return 0; } |