Lines Matching defs:file
115 if (!f.file)
128 container = vfio_container_from_file(f.file);
134 iommufd = iommufd_ctx_from_file(f.file);
253 static struct file *vfio_device_open_file(struct vfio_device *device)
256 struct file *filep;
293 * On success the ref of device is moved to the file and
310 struct file *filep;
385 static long vfio_group_fops_unl_ioctl(struct file *filep,
432 static int vfio_group_fops_open(struct inode *inode, struct file *filep)
474 static int vfio_group_fops_release(struct inode *inode, struct file *filep)
482 * Device FDs hold a group file reference, therefore the group release
816 struct vfio_group *vfio_group_from_file(struct file *file)
818 struct vfio_group *group = file->private_data;
820 if (file->f_op != &vfio_group_fops)
826 * vfio_file_iommu_group - Return the struct iommu_group for the vfio group file
827 * @file: VFIO group file
829 * The returned iommu_group is valid as long as a ref is held on the file. This
833 struct iommu_group *vfio_file_iommu_group(struct file *file)
835 struct vfio_group *group = vfio_group_from_file(file);
855 * vfio_file_is_group - True if the file is a vfio group file
856 * @file: VFIO group file
858 bool vfio_file_is_group(struct file *file)
860 return vfio_group_from_file(file);
895 * vfio_file_has_dev - True if the VFIO file is a handle for device
896 * @file: VFIO file to check
897 * @device: Device that must be part of the file
899 * Returns true if given file has permission to manipulate the given device.
901 bool vfio_file_has_dev(struct file *file, struct vfio_device *device)
903 struct vfio_group *group = vfio_group_from_file(file);