Lines Matching defs:file

9 #include <linux/file.h>
121 static int eventfd_release(struct inode *inode, struct file *file)
123 struct eventfd_ctx *ctx = file->private_data;
130 static __poll_t eventfd_poll(struct file *file, poll_table *wait)
132 struct eventfd_ctx *ctx = file->private_data;
136 poll_wait(file, &ctx->wqh, wait);
228 struct file *file = iocb->ki_filp;
229 struct eventfd_ctx *ctx = file->private_data;
236 if ((file->f_flags & O_NONBLOCK) ||
259 static ssize_t eventfd_write(struct file *file, const char __user *buf, size_t count,
262 struct eventfd_ctx *ctx = file->private_data;
276 else if (!(file->f_flags & O_NONBLOCK)) {
295 static void eventfd_show_fdinfo(struct seq_file *m, struct file *f)
321 * eventfd_fget - Acquire a reference of an eventfd file descriptor.
322 * @fd: [in] Eventfd file descriptor.
324 * Returns a pointer to the eventfd file structure in case of success, or the
327 * -EBADF : Invalid @fd file descriptor.
328 * -EINVAL : The @fd file descriptor is not an eventfd file.
330 struct file *eventfd_fget(int fd)
332 struct file *file;
334 file = fget(fd);
335 if (!file)
337 if (file->f_op != &eventfd_fops) {
338 fput(file);
342 return file;
348 * @fd: [in] Eventfd file descriptor.
359 if (!f.file)
361 ctx = eventfd_ctx_fileget(f.file);
369 * @file: [in] Eventfd file pointer.
374 * -EINVAL : The @fd file descriptor is not an eventfd file.
376 struct eventfd_ctx *eventfd_ctx_fileget(struct file *file)
380 if (file->f_op != &eventfd_fops)
383 ctx = file->private_data;
392 struct file *file;
418 file = anon_inode_getfile("[eventfd]", &eventfd_fops, ctx, flags);
419 if (IS_ERR(file)) {
421 fd = PTR_ERR(file);
425 file->f_mode |= FMODE_NOWAIT;
426 fd_install(fd, file);