Lines Matching refs:file
53 #include <linux/file.h>
460 if (req->file && !(req->flags & REQ_F_FIXED_FILE))
461 req->flags |= io_file_get_flags(req->file);
463 if (req->file && (req->flags & REQ_F_ISREG)) {
467 if (should_hash && (req->file->f_flags & O_DIRECT) &&
468 (req->file->f_mode & FMODE_DIO_PARALLEL_WRITE))
471 io_wq_hash_work(&req->work, file_inode(req->file));
472 } else if (!req->file || !S_ISBLK(file_inode(req->file)->i_mode)) {
1561 /* See comment at the top of this file */
1701 if (list_req->file != req->file)
1729 unsigned int io_file_get_flags(struct file *file)
1733 if (S_ISREG(file_inode(file)->i_mode))
1735 if ((file->f_flags & O_NONBLOCK) || (file->f_mode & FMODE_NOWAIT))
1756 /* assign early for deferred execution for non-fixed file */
1757 if (def->needs_file && !(req->flags & REQ_F_FIXED_FILE) && !req->file)
1758 req->file = io_file_get_normal(req, req->cqe.fd);
1825 if (req->file || !def->needs_file)
1829 req->file = io_file_get_fixed(req, req->cqe.fd, issue_flags);
1831 req->file = io_file_get_normal(req, req->cqe.fd);
1833 return !!req->file;
1871 /* If the op doesn't have a file, we're not polling for it */
1929 if (opcode_poll && file_can_poll(req->file)) {
1973 inline struct file *io_file_get_fixed(struct io_kiocb *req, int fd,
1978 struct file *file = NULL;
1986 file = io_slot_file(slot);
1991 return file;
1994 struct file *io_file_get_normal(struct io_kiocb *req, int fd)
1996 struct file *file = fget(fd);
2001 if (file && io_is_uring_fops(file))
2003 return file;
2043 * We async punt it if the file wasn't marked NOWAIT, or if the file
2134 req->file = NULL;
2980 static __poll_t io_uring_poll(struct file *file, poll_table *wait)
2982 struct io_ring_ctx *ctx = file->private_data;
2988 poll_wait(file, &ctx->poll_wq, wait);
3187 static int io_uring_release(struct inode *inode, struct file *file)
3189 struct io_ring_ctx *ctx = file->private_data;
3191 file->private_data = NULL;
3409 static void *io_uring_validate_mmap_request(struct file *file,
3412 struct io_ring_ctx *ctx = file->private_data;
3455 static __cold int io_uring_mmap(struct file *file, struct vm_area_struct *vma)
3461 ptr = io_uring_validate_mmap_request(file, vma->vm_pgoff, sz);
3469 static unsigned long io_uring_mmu_get_unmapped_area(struct file *filp,
3491 * - use a NULL file pointer to reference physical memory, and
3514 static int io_uring_mmap(struct file *file, struct vm_area_struct *vma)
3519 static unsigned int io_uring_nommu_mmap_capabilities(struct file *file)
3524 static unsigned long io_uring_nommu_get_unmapped_area(struct file *file,
3530 ptr = io_uring_validate_mmap_request(file, pgoff, len);
3589 struct file *file;
3607 file = tctx->registered_rings[fd];
3608 if (unlikely(!file))
3611 file = fget(fd);
3612 if (unlikely(!file))
3615 if (unlikely(!io_is_uring_fops(file)))
3619 ctx = file->private_data;
3714 fput(file);
3733 bool io_is_uring_fops(struct file *file)
3735 return file->f_op == &io_uring_fops;
3792 static int io_uring_install_fd(struct file *file)
3799 fd_install(fd, file);
3808 static struct file *io_uring_get_file(struct io_ring_ctx *ctx)
3819 struct file *file;
3988 file = io_uring_get_file(ctx);
3989 if (IS_ERR(file)) {
3990 ret = PTR_ERR(file);
4004 ret = io_ring_add_registered_file(tctx, file, 0, IO_RINGFD_REG_MAX);
4006 ret = io_uring_install_fd(file);
4016 fput(file);
4373 * dying as we're holding a file ref here.
4535 struct file *file;
4554 file = tctx->registered_rings[fd];
4555 if (unlikely(!file))
4558 file = fget(fd);
4559 if (unlikely(!file))
4562 if (!io_is_uring_fops(file))
4566 ctx = file->private_data;
4574 fput(file);
4656 * file in io_kiocb and until the opcode field. The openat2 handling