summaryrefslogtreecommitdiffstats
path: root/drivers/vfio/device_cdev.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:16:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:16:07 +0000
commitff146e0175fa9b27a6838c64c76f1e3d4b4cc6a6 (patch)
treeeb37b8a1f852d4b842862b002c1da338ee11d9d2 /drivers/vfio/device_cdev.c
parentAdding upstream version 6.9.10. (diff)
downloadlinux-upstream/6.9.11.tar.xz
linux-upstream/6.9.11.zip
Adding upstream version 6.9.11.upstream/6.9.11
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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: