summaryrefslogtreecommitdiffstats
path: root/drivers/vfio/device_cdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/vfio/device_cdev.c')
-rw-r--r--drivers/vfio/device_cdev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/vfio/device_cdev.c b/drivers/vfio/device_cdev.c
index e75da0a70d..bb1817bd4f 100644
--- a/drivers/vfio/device_cdev.c
+++ b/drivers/vfio/device_cdev.c
@@ -39,6 +39,13 @@ int vfio_device_fops_cdev_open(struct inode *inode, struct file *filep)
filep->private_data = df;
+ /*
+ * Use the pseudo fs inode on the device to link all mmaps
+ * to the same address space, allowing us to unmap all vmas
+ * associated to this device using unmap_mapping_range().
+ */
+ filep->f_mapping = device->inode->i_mapping;
+
return 0;
err_put_registration: