mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 5/6] epoll keyed wakeups v2 - make eventfd use keyed wakeups
@ 2009-02-01 20:04 Davide Libenzi
  0 siblings, 0 replies; only message in thread
From: Davide Libenzi @ 2009-02-01 20:04 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Andrew Morton, Linus Torvalds, Alan Cox, Ingo Molnar, David Miller

The following patch introduces keyed event wakeups inside the eventfd code.



Signed-off-by: Davide Libenzi <davidel@xmailserver.org>


- Davide


---
 fs/eventfd.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6.mod/fs/eventfd.c
===================================================================
--- linux-2.6.mod.orig/fs/eventfd.c	2009-01-31 14:55:13.000000000 -0800
+++ linux-2.6.mod/fs/eventfd.c	2009-01-31 15:36:00.000000000 -0800
@@ -50,7 +50,7 @@ int eventfd_signal(struct file *file, in
 		n = (int) (ULLONG_MAX - ctx->count);
 	ctx->count += n;
 	if (waitqueue_active(&ctx->wqh))
-		wake_up_locked(&ctx->wqh);
+		wake_up_locked_poll(&ctx->wqh, POLLIN);
 	spin_unlock_irqrestore(&ctx->wqh.lock, flags);
 
 	return n;
@@ -120,7 +120,7 @@ static ssize_t eventfd_read(struct file 
 	if (res > 0) {
 		ctx->count = 0;
 		if (waitqueue_active(&ctx->wqh))
-			wake_up_locked(&ctx->wqh);
+			wake_up_locked_poll(&ctx->wqh, POLLOUT);
 	}
 	spin_unlock_irq(&ctx->wqh.lock);
 	if (res > 0 && put_user(ucnt, (__u64 __user *) buf))
@@ -169,7 +169,7 @@ static ssize_t eventfd_write(struct file
 	if (res > 0) {
 		ctx->count += ucnt;
 		if (waitqueue_active(&ctx->wqh))
-			wake_up_locked(&ctx->wqh);
+			wake_up_locked_poll(&ctx->wqh, POLLIN);
 	}
 	spin_unlock_irq(&ctx->wqh.lock);
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-01 20:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-01 20:04 [patch 5/6] epoll keyed wakeups v2 - make eventfd use keyed wakeups Davide Libenzi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®