summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2013-08-27 18:20:26 (GMT)
committerScott Wood <scottwood@freescale.com>2015-02-13 22:21:13 (GMT)
commitc8d506dea6b3417d35668818c1476b5080a42670 (patch)
tree9ae36c9a69d2fb44cb81db105123cd8081c90b66 /include
parentf2e61f38c65d5551e72d06329e1c9e951261c12c (diff)
downloadlinux-fsl-qoriq-c8d506dea6b3417d35668818c1476b5080a42670.tar.xz
simple-wait: rename and export the equivalent of waitqueue_active()
The function "swait_head_has_waiters()" was internalized into wait-simple.c but it parallels the waitqueue_active of normal waitqueue support. Given that there are over 150 waitqueue_active users in drivers/ fs/ kernel/ and the like, lets make it globally visible, and rename it to parallel the waitqueue_active accordingly. We'll need to do this if we expect to expand its usage beyond RT. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/wait-simple.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/wait-simple.h b/include/linux/wait-simple.h
index 4efba4d..f86bca2 100644
--- a/include/linux/wait-simple.h
+++ b/include/linux/wait-simple.h
@@ -47,6 +47,14 @@ extern void swait_prepare(struct swait_head *head, struct swaiter *w, int state)
extern void swait_finish_locked(struct swait_head *head, struct swaiter *w);
extern void swait_finish(struct swait_head *head, struct swaiter *w);
+/* Check whether a head has waiters enqueued */
+static inline bool swaitqueue_active(struct swait_head *h)
+{
+ /* Make sure the condition is visible before checking list_empty() */
+ smp_mb();
+ return !list_empty(&h->list);
+}
+
/*
* Wakeup functions
*/