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;
56 static void vfio_df_get_kvm_safe(struct vfio_device_file *df)
58 spin_lock(&df->kvm_ref_lock);
59 vfio_device_get_kvm_safe(df->device, df->kvm);
60 spin_unlock(&df->kvm_ref_lock);
83 long vfio_df_ioctl_bind_iommufd(struct vfio_device_file *df,
87 struct vfio_device *device = df->device;
93 static_assert(__same_type(arg->out_devid, df->devid));
110 if (df->group)
119 if (df->access_granted) {
128 df->iommufd = iommufd_ctx_from_fd(bind.iommufd);
129 if (IS_ERR(df->iommufd)) {
130 ret = PTR_ERR(df->iommufd);
131 df->iommufd = NULL;
141 vfio_df_get_kvm_safe(df);
143 ret = vfio_df_open(df);
147 ret = copy_to_user(&arg->out_devid, &df->devid,
148 sizeof(df->devid)) ? -EFAULT : 0;
157 smp_store_release(&df->access_granted, true);
162 vfio_df_close(df);
165 iommufd_ctx_put(df->iommufd);
166 df->iommufd = NULL;
173 void vfio_df_unbind_iommufd(struct vfio_device_file *df)
175 struct vfio_device *device = df->device;
179 * changing this flag. So read df->access_granted without lock
182 if (!df->access_granted)
186 vfio_df_close(df);
188 iommufd_ctx_put(df->iommufd);
194 int vfio_df_ioctl_attach_pt(struct vfio_device_file *df,
198 struct vfio_device *device = df->device;
253 int vfio_df_ioctl_detach_pt(struct vfio_device_file *df,
257 struct vfio_device *device = df->device;