Re: [PATCH v2 1/2] vfio: Create vfio_fs_type with inode per device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 1 Jun 2024 07:41:15 +0800
Yan Zhao <yan.y.zhao@xxxxxxxxx> wrote:

> On Wed, May 29, 2024 at 10:52:30PM -0600, Alex Williamson wrote:
> ...
> > diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c
> > index 610a429c6191..ded364588d29 100644
> > --- a/drivers/vfio/group.c
> > +++ b/drivers/vfio/group.c
> > @@ -286,6 +286,13 @@ static struct file *vfio_device_open_file(struct vfio_device *device)
> >  	 */
> >  	filep->f_mode |= (FMODE_PREAD | FMODE_PWRITE);
> >    
> Instead of using anon_inode_getfile(), is it possible to get the filep like
> filep = alloc_file_pseudo_noaccount(device->inode,
> get_vfs_mount(),"[vfio-device]", O_RDWR, &vfio_device_fops);
> 
> > +	/*
> > +	 * 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;  
> Then this is not necessary here. 

Maybe?  The code paths are not obviously equivalent to me, so I think
this adds risk to a series being proposed for the rc cycle.  Would you
like to propose this as a change on top of this series for v6.11?
Thanks,

Alex





[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux