summaryrefslogtreecommitdiff
path: root/fs/fscache
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2018-03-15 13:43:43 +0300
committerIngo Molnar <mingo@kernel.org>2018-03-20 10:23:21 +0300
commitdc5d4afbb0bf7b7746ff5e56e1a5688ad7f29b32 (patch)
treeaab1e218aa98304737514a9c46416c0d44c200e6 /fs/fscache
parent4625956a4ec20c623acbbb0c6d60fcb388387ba8 (diff)
downloadlinux-dc5d4afbb0bf7b7746ff5e56e1a5688ad7f29b32.tar.xz
sched/wait, fs/fscache: Convert wait_on_atomic_t() usage to the new wait_var_event() API
The old wait_on_atomic_t() is going to get removed, use the more flexible wait_var_event() API instead. No change in functionality. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: David Howells <dhowells@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/fscache')
-rw-r--r--fs/fscache/cookie.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
index ff84258132bb..d705125665f0 100644
--- a/fs/fscache/cookie.c
+++ b/fs/fscache/cookie.c
@@ -557,9 +557,10 @@ void __fscache_disable_cookie(struct fscache_cookie *cookie, bool invalidate)
* n_active reaches 0). This makes sure outstanding reads and writes
* have completed.
*/
- if (!atomic_dec_and_test(&cookie->n_active))
- wait_on_atomic_t(&cookie->n_active, atomic_t_wait,
- TASK_UNINTERRUPTIBLE);
+ if (!atomic_dec_and_test(&cookie->n_active)) {
+ wait_var_event(&cookie->n_active,
+ !atomic_read(&cookie->n_active));
+ }
/* Make sure any pending writes are cancelled. */
if (cookie->def->type != FSCACHE_COOKIE_TYPE_INDEX)