Lines Matching defs:df
27 struct vfio_device_file *df;
34 df = vfio_allocate_device_file(device);
35 if (IS_ERR(df)) {
36 ret = PTR_ERR(df);
40 filep->private_data = df;
49 static void vfio_df_get_kvm_safe(struct vfio_device_file *df)
51 spin_lock(&df->kvm_ref_lock);
52 vfio_device_get_kvm_safe(df->device, df->kvm);
53 spin_unlock(&df->kvm_ref_lock);
56 long vfio_df_ioctl_bind_iommufd(struct vfio_device_file *df,
59 struct vfio_device *device = df->device;
64 static_assert(__same_type(arg->out_devid, df->devid));
75 if (df->group)
84 if (df->access_granted) {
89 df->iommufd = iommufd_ctx_from_fd(bind.iommufd);
90 if (IS_ERR(df->iommufd)) {
91 ret = PTR_ERR(df->iommufd);
92 df->iommufd = NULL;
102 vfio_df_get_kvm_safe(df);
104 ret = vfio_df_open(df);
108 ret = copy_to_user(&arg->out_devid, &df->devid,
109 sizeof(df->devid)) ? -EFAULT : 0;
118 smp_store_release(&df->access_granted, true);
123 vfio_df_close(df);
126 iommufd_ctx_put(df->iommufd);
127 df->iommufd = NULL;
134 void vfio_df_unbind_iommufd(struct vfio_device_file *df)
136 struct vfio_device *device = df->device;
140 * changing this flag. So read df->access_granted without lock
143 if (!df->access_granted)
147 vfio_df_close(df);
149 iommufd_ctx_put(df->iommufd);
155 int vfio_df_ioctl_attach_pt(struct vfio_device_file *df,
158 struct vfio_device *device = df->device;
191 int vfio_df_ioctl_detach_pt(struct vfio_device_file *df,
194 struct vfio_device *device = df->device;