mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
epoll keyed wakeups: make eventfd use keyed wakeups
Introduce keyed event wakeups inside the eventfd code. Signed-off-by: Davide Libenzi <[email protected]> Cc: Alan Cox <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: David Miller <[email protected]> Cc: William Lee Irwin III <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
2dfa4eeab0
commit
395108880e
1 changed files with 3 additions and 3 deletions
|
|
@ -51,7 +51,7 @@ int eventfd_signal(struct file *file, int n)
|
|||
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 *file, char __user *buf, size_t count,
|
|||
ucnt = (ctx->flags & EFD_SEMAPHORE) ? 1 : ctx->count;
|
||||
ctx->count -= ucnt;
|
||||
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 *file, const char __user *buf, size_t c
|
|||
if (likely(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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue