Skip to content

Commit dc5d4af

Browse files
Peter Zijlstraingomolnar
authored andcommitted
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>
1 parent 4625956 commit dc5d4af

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎fs/fscache/cookie.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,10 @@ void __fscache_disable_cookie(struct fscache_cookie *cookie, bool invalidate)
557557
* n_active reaches 0). This makes sure outstanding reads and writes
558558
* have completed.
559559
*/
560-
if (!atomic_dec_and_test(&cookie->n_active))
561-
wait_on_atomic_t(&cookie->n_active, atomic_t_wait,
562-
TASK_UNINTERRUPTIBLE);
560+
if (!atomic_dec_and_test(&cookie->n_active)) {
561+
wait_var_event(&cookie->n_active,
562+
!atomic_read(&cookie->n_active));
563+
}
563564

564565
/* Make sure any pending writes are cancelled. */
565566
if (cookie->def->type != FSCACHE_COOKIE_TYPE_INDEX)

‎include/linux/fscache-cache.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ static inline bool __fscache_unuse_cookie(struct fscache_cookie *cookie)
496496

497497
static inline void __fscache_wake_unused_cookie(struct fscache_cookie *cookie)
498498
{
499-
wake_up_atomic_t(&cookie->n_active);
499+
wake_up_var(&cookie->n_active);
500500
}
501501

502502
/**

0 commit comments

Comments
 (0)