diff options
author | Christoph Hellwig <hch@lst.de> | 2017-12-31 10:42:48 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-26 03:16:44 -0400 |
commit | 9e42f195f5b5cae4cf8ec71432c0fdaf641d1b73 (patch) | |
tree | 0f301ef42421c1581d214dc84cb46e0eed15c37c /fs/eventfd.c | |
parent | dd67081b36a1fb41f632e2fe69992786396c9e77 (diff) |
eventfd: switch to ->poll_mask
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/eventfd.c')
-rw-r--r-- | fs/eventfd.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/fs/eventfd.c b/fs/eventfd.c index 08d3bd602f73..61c9514da5e9 100644 --- a/fs/eventfd.c +++ b/fs/eventfd.c | |||
@@ -101,14 +101,20 @@ static int eventfd_release(struct inode *inode, struct file *file) | |||
101 | return 0; | 101 | return 0; |
102 | } | 102 | } |
103 | 103 | ||
104 | static __poll_t eventfd_poll(struct file *file, poll_table *wait) | 104 | static struct wait_queue_head * |
105 | eventfd_get_poll_head(struct file *file, __poll_t events) | ||
106 | { | ||
107 | struct eventfd_ctx *ctx = file->private_data; | ||
108 | |||
109 | return &ctx->wqh; | ||
110 | } | ||
111 | |||
112 | static __poll_t eventfd_poll_mask(struct file *file, __poll_t eventmask) | ||
105 | { | 113 | { |
106 | struct eventfd_ctx *ctx = file->private_data; | 114 | struct eventfd_ctx *ctx = file->private_data; |
107 | __poll_t events = 0; | 115 | __poll_t events = 0; |
108 | u64 count; | 116 | u64 count; |
109 | 117 | ||
110 | poll_wait(file, &ctx->wqh, wait); | ||
111 | |||
112 | /* | 118 | /* |
113 | * All writes to ctx->count occur within ctx->wqh.lock. This read | 119 | * All writes to ctx->count occur within ctx->wqh.lock. This read |
114 | * can be done outside ctx->wqh.lock because we know that poll_wait | 120 | * can be done outside ctx->wqh.lock because we know that poll_wait |
@@ -305,7 +311,8 @@ static const struct file_operations eventfd_fops = { | |||
305 | .show_fdinfo = eventfd_show_fdinfo, | 311 | .show_fdinfo = eventfd_show_fdinfo, |
306 | #endif | 312 | #endif |
307 | .release = eventfd_release, | 313 | .release = eventfd_release, |
308 | .poll = eventfd_poll, | 314 | .get_poll_head = eventfd_get_poll_head, |
315 | .poll_mask = eventfd_poll_mask, | ||
309 | .read = eventfd_read, | 316 | .read = eventfd_read, |
310 | .write = eventfd_write, | 317 | .write = eventfd_write, |
311 | .llseek = noop_llseek, | 318 | .llseek = noop_llseek, |