.. | .. |
---|
266 | 266 | return sizeof(ucnt); |
---|
267 | 267 | } |
---|
268 | 268 | |
---|
269 | | -static ssize_t eventfd_write(struct file *file, const char __user *buf, size_t count, |
---|
270 | | - loff_t *ppos) |
---|
| 269 | +static ssize_t eventfd_write(struct kiocb *iocb, struct iov_iter *from) |
---|
271 | 270 | { |
---|
| 271 | + struct file *file = iocb->ki_filp; |
---|
272 | 272 | struct eventfd_ctx *ctx = file->private_data; |
---|
273 | 273 | ssize_t res; |
---|
274 | 274 | __u64 ucnt; |
---|
275 | 275 | DECLARE_WAITQUEUE(wait, current); |
---|
276 | 276 | |
---|
277 | | - if (count < sizeof(ucnt)) |
---|
| 277 | + if (iov_iter_count(from) < sizeof(ucnt)) |
---|
278 | 278 | return -EINVAL; |
---|
279 | | - if (copy_from_user(&ucnt, buf, sizeof(ucnt))) |
---|
| 279 | + if (copy_from_iter(&ucnt, sizeof(ucnt), from) != sizeof(ucnt)) |
---|
280 | 280 | return -EFAULT; |
---|
281 | 281 | if (ucnt == ULLONG_MAX) |
---|
282 | 282 | return -EINVAL; |
---|
.. | .. |
---|
333 | 333 | .release = eventfd_release, |
---|
334 | 334 | .poll = eventfd_poll, |
---|
335 | 335 | .read_iter = eventfd_read, |
---|
336 | | - .write = eventfd_write, |
---|
| 336 | + .write_iter = eventfd_write, |
---|
337 | 337 | .llseek = noop_llseek, |
---|
338 | 338 | }; |
---|
339 | 339 | |
---|