Provide an add_wait_queue_tail() function to add a waiter to the back of a
wait queue instead of the front.
Signed-off-by: David Howells <dhowells@redhat.com>
---
include/linux/wait.h | 2 ++
kernel/wait.c | 18 ++++++++++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/include/linux/wait.h b/include/linux/wait.h
index 0e68628..f1038d0 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -118,6 +118,8 @@ static inline int waitqueue_active(wait_queue_head_t *q)
#define is_sync_wait(wait) (!(wait) || ((wait)->private))
extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait));
+extern void FASTCALL(add_wait_queue_tail(wait_queue_head_t *q,
+ wait_queue_t *wait));
extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait));
extern void FASTCALL(remove_wait_queue(wait_queue_head_t *q, wait_queue_t * wait));
diff --git a/kernel/wait.c b/kernel/wait.c
index 444ddbf..7acc9cc 100644
--- a/kernel/wait.c
+++ b/kernel/wait.c
@@ -29,6 +29,24 @@ void fastcall add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait)
}
EXPORT_SYMBOL(add_wait_queue);
+/**
+ * add_wait_queue_tail - Add a waiter to the back of a waitqueue
+ * @q: the wait queue to append the waiter to
+ * @wait: the waiter to be queued
+ *
+ * Add a waiter to the back of a waitqueue so that it gets woken up last.
+ */
+void fastcall add_wait_queue_tail(wait_queue_head_t *q, wait_queue_t *wait)
+{
+ unsigned long flags;
+
+ wait->flags &= ~WQ_FLAG_EXCLUSIVE;
+ spin_lock_irqsave(&q->lock, flags);
+ __add_wait_queue_tail(q, wait);
+ spin_unlock_irqrestore(&q->lock, flags);
+}
+EXPORT_SYMBOL(add_wait_queue_tail);
+
void fastcall add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait)
{
unsigned long flags;
--
| David Miller | [GIT]: Networking |
| Fred . | Please add ZFS support (from GPL sources) |
| Rusty Russell | Re: [patch 13/26] Xen-paravirt_ops: Consistently wrap paravirt ops callsites to ma... |
| Amit K. Arora | [RFC] Heads up on sys_fallocate() |
| Neng-Yu Tu (Tony Tu) | GTA02 GPS rework for SD card interference issue |
| nickd | Re: My experience with the Freerunner |
| Flemming Richter Mikkelsen | Re: QVGA V/s VGA for GTA03 (was something about yummy CPU-GPU combos!) |
| cedric cellier | Re: comparing Apples and Oranges $199 iPhone Freerunner GTA02 |
git: | |
| Toby White | Using Filemerge.app as a git-diff viewer |
| Nicolas Pitre | Re: Cleaning up git user-interface warts |
| Jon Smirl | ! [rejected] master -> master (non-fast forward) |
| Abdelrazak Younes | Git-windows and git-svn? |
| Kevin Stam | Re: Code signing in OpenBSD |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| christian johansson | openbsd on a geode |
| Karel Kulhavy | lookup option in /etc/resolv.conf ignored |
| SATA 2 size problems | 16 minutes ago | Windows |
| problem with 2.6 kernel driver for a USB MAG Stripe Reader as HID device. | 12 hours ago | Linux kernel |
| get_user_pages failure | 14 hours ago | Linux kernel |
| Reading linux kernel | 15 hours ago | Linux kernel |
| High level of Seagate 2.5" SATA drives failing | 21 hours ago | Hardware |
| Resetting the bios password for Toshiba Laptop | 1 day ago | Hardware |
| Linux 2.6.22 slowly RUNS OUT OF LOWMEM | 1 day ago | Linux kernel |
| Questions about modules | 1 day ago | Linux kernel |
| KDB | 2 days ago | Linux kernel |
| Writing a framebuffer driver for an embedded spi interface (!!) | 2 days ago | Linux kernel |
