Commit dc5d4afb authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

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: default avatarPeter 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: default avatarIngo Molnar <mingo@kernel.org>
parent 4625956a
...@@ -557,9 +557,10 @@ void __fscache_disable_cookie(struct fscache_cookie *cookie, bool invalidate) ...@@ -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 * n_active reaches 0). This makes sure outstanding reads and writes
* have completed. * have completed.
*/ */
if (!atomic_dec_and_test(&cookie->n_active)) if (!atomic_dec_and_test(&cookie->n_active)) {
wait_on_atomic_t(&cookie->n_active, atomic_t_wait, wait_var_event(&cookie->n_active,
TASK_UNINTERRUPTIBLE); !atomic_read(&cookie->n_active));
}
/* Make sure any pending writes are cancelled. */ /* Make sure any pending writes are cancelled. */
if (cookie->def->type != FSCACHE_COOKIE_TYPE_INDEX) if (cookie->def->type != FSCACHE_COOKIE_TYPE_INDEX)
......
...@@ -496,7 +496,7 @@ static inline bool __fscache_unuse_cookie(struct fscache_cookie *cookie) ...@@ -496,7 +496,7 @@ static inline bool __fscache_unuse_cookie(struct fscache_cookie *cookie)
static inline void __fscache_wake_unused_cookie(struct fscache_cookie *cookie) static inline void __fscache_wake_unused_cookie(struct fscache_cookie *cookie)
{ {
wake_up_atomic_t(&cookie->n_active); wake_up_var(&cookie->n_active);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment