aboutsummaryrefslogtreecommitdiffstats
path: root/fs/timerfd.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/timerfd.c')
-rw-r--r--fs/timerfd.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/timerfd.c b/fs/timerfd.c
index d84a2bee4f82..cdad49da3ff7 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -226,20 +226,21 @@ static int timerfd_release(struct inode *inode, struct file *file)
226 kfree_rcu(ctx, rcu); 226 kfree_rcu(ctx, rcu);
227 return 0; 227 return 0;
228} 228}
229 229
230static struct wait_queue_head *timerfd_get_poll_head(struct file *file, 230static __poll_t timerfd_poll(struct file *file, poll_table *wait)
231 __poll_t eventmask)
232{ 231{
233 struct timerfd_ctx *ctx = file->private_data; 232 struct timerfd_ctx *ctx = file->private_data;
233 __poll_t events = 0;
234 unsigned long flags;
234 235
235 return &ctx->wqh; 236 poll_wait(file, &ctx->wqh, wait);
236}
237 237
238static __poll_t timerfd_poll_mask(struct file *file, __poll_t eventmask) 238 spin_lock_irqsave(&ctx->wqh.lock, flags);
239{ 239 if (ctx->ticks)
240 struct timerfd_ctx *ctx = file->private_data; 240 events |= EPOLLIN;
241 spin_unlock_irqrestore(&ctx->wqh.lock, flags);
241 242
242 return ctx->ticks ? EPOLLIN : 0; 243 return events;
243} 244}
244 245
245static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count, 246static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count,
@@ -363,8 +364,7 @@ static long timerfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg
363 364
364static const struct file_operations timerfd_fops = { 365static const struct file_operations timerfd_fops = {
365 .release = timerfd_release, 366 .release = timerfd_release,
366 .get_poll_head = timerfd_get_poll_head, 367 .poll = timerfd_poll,
367 .poll_mask = timerfd_poll_mask,
368 .read = timerfd_read, 368 .read = timerfd_read,
369 .llseek = noop_llseek, 369 .llseek = noop_llseek,
370 .show_fdinfo = timerfd_show, 370 .show_fdinfo = timerfd_show,