Commit 7dda7128 authored by Christoph Hellwig's avatar Christoph Hellwig

timerfd: add support for keyed wakeups

This prepares timerfd for use with aio poll.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Tested-by: default avatarAvi Kivity <avi@scylladb.com>
parent 1ffaddd0
...@@ -66,7 +66,7 @@ static void timerfd_triggered(struct timerfd_ctx *ctx) ...@@ -66,7 +66,7 @@ static void timerfd_triggered(struct timerfd_ctx *ctx)
spin_lock_irqsave(&ctx->wqh.lock, flags); spin_lock_irqsave(&ctx->wqh.lock, flags);
ctx->expired = 1; ctx->expired = 1;
ctx->ticks++; ctx->ticks++;
wake_up_locked(&ctx->wqh); wake_up_locked_poll(&ctx->wqh, EPOLLIN);
spin_unlock_irqrestore(&ctx->wqh.lock, flags); spin_unlock_irqrestore(&ctx->wqh.lock, flags);
} }
...@@ -107,7 +107,7 @@ void timerfd_clock_was_set(void) ...@@ -107,7 +107,7 @@ void timerfd_clock_was_set(void)
if (ctx->moffs != moffs) { if (ctx->moffs != moffs) {
ctx->moffs = KTIME_MAX; ctx->moffs = KTIME_MAX;
ctx->ticks++; ctx->ticks++;
wake_up_locked(&ctx->wqh); wake_up_locked_poll(&ctx->wqh, EPOLLIN);
} }
spin_unlock_irqrestore(&ctx->wqh.lock, flags); spin_unlock_irqrestore(&ctx->wqh.lock, flags);
} }
...@@ -345,7 +345,7 @@ static long timerfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg ...@@ -345,7 +345,7 @@ static long timerfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg
spin_lock_irq(&ctx->wqh.lock); spin_lock_irq(&ctx->wqh.lock);
if (!timerfd_canceled(ctx)) { if (!timerfd_canceled(ctx)) {
ctx->ticks = ticks; ctx->ticks = ticks;
wake_up_locked(&ctx->wqh); wake_up_locked_poll(&ctx->wqh, EPOLLIN);
} else } else
ret = -ECANCELED; ret = -ECANCELED;
spin_unlock_irq(&ctx->wqh.lock); spin_unlock_irq(&ctx->wqh.lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment