RE: [PATCH v3 13/15] vfio: Add cdev for vfio_device

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

 



> From: Tian, Kevin <kevin.tian@xxxxxxxxx>
> Sent: Tuesday, February 14, 2023 4:32 PM
> 
> > From: Liu, Yi L <yi.l.liu@xxxxxxxxx>
> > Sent: Monday, February 13, 2023 11:14 PM
> >
> > +/*
> > + * cdev open op. device access via the fd opened by this function
> > + * is blocked until .open_device() is called successfully during
> > + * BIND_IOMMUFD.
> > + */
> 
> remove "cdev open op"
> 
> > +int vfio_device_fops_open(struct inode *inode, struct file *filep)
> 
> vfio_device_fops_cdev_open()
> 
> >
> > +static int vfio_device_add(struct vfio_device *device)
> > +{
> > +	int ret;
> > +
> > +	if (IS_ENABLED(CONFIG_VFIO_DEVICE_CDEV))
> > +		ret = cdev_device_add(&device->cdev, &device->device);
> > +	else
> > +		ret = device_add(&device->device);
> > +	return ret;
> > +}
> > +
> > +static void vfio_device_del(struct vfio_device *device)
> > +{
> > +	if (IS_ENABLED(CONFIG_VFIO_DEVICE_CDEV))
> > +		cdev_device_del(&device->cdev, &device->device);
> > +	else
> > +		device_del(&device->device);
> > +}
> > +
> 
> move to header file and have CONFIG_VFIO_DEVICE_CDEV
> wrapping vfio_device_add/del() directly.

Ok. 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux