summaryrefslogtreecommitdiffstats
path: root/fs/fscache
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2017-11-02 11:27:44 -0400
committerDavid Howells <dhowells@redhat.com>2017-11-13 10:38:16 -0500
commit5e4def20381678ba3ce0a4e117f97e378ecd81bc (patch)
tree455d2c682d9430a06bf2eb91b12e7eba9b1a645e /fs/fscache
parent81445e63e67a1e98b1c2575fa2b406d4289d2754 (diff)
Pass mode to wait_on_atomic_t() action funcs and provide default actions
Make wait_on_atomic_t() pass the TASK_* mode onto its action function as an extra argument and make it 'unsigned int throughout. Also, consolidate a bunch of identical action functions into a default function that can do the appropriate thing for the mode. Also, change the argument name in the bit_wait*() function declarations to reflect the fact that it's the mode and not the bit number. [Peter Z gives this a grudging ACK, but thinks that the whole atomic_t wait should be done differently, though he's not immediately sure as to how] Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Peter Zijlstra <peterz@infradead.org> cc: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/fscache')
-rw-r--r--fs/fscache/cookie.c2
-rw-r--r--fs/fscache/internal.h2
-rw-r--r--fs/fscache/main.c9
3 files changed, 1 insertions, 12 deletions
diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
index 40d61077bead..ff84258132bb 100644
--- a/fs/fscache/cookie.c
+++ b/fs/fscache/cookie.c
@@ -558,7 +558,7 @@ void __fscache_disable_cookie(struct fscache_cookie *cookie, bool invalidate)
558 * have completed. 558 * have completed.
559 */ 559 */
560 if (!atomic_dec_and_test(&cookie->n_active)) 560 if (!atomic_dec_and_test(&cookie->n_active))
561 wait_on_atomic_t(&cookie->n_active, fscache_wait_atomic_t, 561 wait_on_atomic_t(&cookie->n_active, atomic_t_wait,
562 TASK_UNINTERRUPTIBLE); 562 TASK_UNINTERRUPTIBLE);
563 563
564 /* Make sure any pending writes are cancelled. */ 564 /* Make sure any pending writes are cancelled. */
diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h
index 97ec45110957..0ff4b49a0037 100644
--- a/fs/fscache/internal.h
+++ b/fs/fscache/internal.h
@@ -97,8 +97,6 @@ static inline bool fscache_object_congested(void)
97 return workqueue_congested(WORK_CPU_UNBOUND, fscache_object_wq); 97 return workqueue_congested(WORK_CPU_UNBOUND, fscache_object_wq);
98} 98}
99 99
100extern int fscache_wait_atomic_t(atomic_t *);
101
102/* 100/*
103 * object.c 101 * object.c
104 */ 102 */
diff --git a/fs/fscache/main.c b/fs/fscache/main.c
index b39d487ccfb0..249968dcbf5c 100644
--- a/fs/fscache/main.c
+++ b/fs/fscache/main.c
@@ -195,12 +195,3 @@ static void __exit fscache_exit(void)
195} 195}
196 196
197module_exit(fscache_exit); 197module_exit(fscache_exit);
198
199/*
200 * wait_on_atomic_t() sleep function for uninterruptible waiting
201 */
202int fscache_wait_atomic_t(atomic_t *p)
203{
204 schedule();
205 return 0;
206}