Lines Matching refs:file
9 #include <linux/file.h>
123 static int eventfd_release(struct inode *inode, struct file *file)
125 struct eventfd_ctx *ctx = file->private_data;
132 static __poll_t eventfd_poll(struct file *file, poll_table *wait)
134 struct eventfd_ctx *ctx = file->private_data;
138 poll_wait(file, &ctx->wqh, wait);
230 struct file *file = iocb->ki_filp;
231 struct eventfd_ctx *ctx = file->private_data;
239 if ((file->f_flags & O_NONBLOCK) ||
272 static ssize_t eventfd_write(struct file *file, const char __user *buf, size_t count,
275 struct eventfd_ctx *ctx = file->private_data;
290 else if (!(file->f_flags & O_NONBLOCK)) {
320 static void eventfd_show_fdinfo(struct seq_file *m, struct file *f)
344 * eventfd_fget - Acquire a reference of an eventfd file descriptor.
345 * @fd: [in] Eventfd file descriptor.
347 * Returns a pointer to the eventfd file structure in case of success, or the
350 * -EBADF : Invalid @fd file descriptor.
351 * -EINVAL : The @fd file descriptor is not an eventfd file.
353 struct file *eventfd_fget(int fd)
355 struct file *file;
357 file = fget(fd);
358 if (!file)
360 if (file->f_op != &eventfd_fops) {
361 fput(file);
365 return file;
371 * @fd: [in] Eventfd file descriptor.
382 if (!f.file)
384 ctx = eventfd_ctx_fileget(f.file);
392 * @file: [in] Eventfd file pointer.
397 * -EINVAL : The @fd file descriptor is not an eventfd file.
399 struct eventfd_ctx *eventfd_ctx_fileget(struct file *file)
403 if (file->f_op != &eventfd_fops)
406 ctx = file->private_data;
415 struct file *file;
441 file = anon_inode_getfile("[eventfd]", &eventfd_fops, ctx, flags);
442 if (IS_ERR(file)) {
444 fd = PTR_ERR(file);
448 file->f_mode |= FMODE_NOWAIT;
449 fd_install(fd, file);