Re: [RFC 1/3] fs: Introduce drmfs pseudo filesystem interfaces

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

 



On Thu, Dec 01, 2016 at 12:32:31PM +0530, swati.dhingra@xxxxxxxxx wrote:
> +int drmfs_init(void)
> +{
> +	int retval;
> +
> +	retval = sysfs_create_mount_point(kernel_kobj, "drm");
> +	if (retval)
> +		return -EINVAL;
> +
> +	retval = register_filesystem(&drm_fs_type);
> +	if (!retval)
> +		drmfs_registered = true;
> +
> +	return retval;
> +}
> +EXPORT_SYMBOL(drmfs_init);
> +
> +int drmfs_fini(void)
> +{
> +	int retval;
> +
> +	retval = unregister_filesystem(&drm_fs_type);
> +	if (retval)
> +		return retval;
> +
> +	drmfs_registered = false;
> +
> +	sysfs_remove_mount_point(kernel_kobj, "drm");
> +}
> +EXPORT_SYMBOL(drmfs_fini);

This needs to act like a singleton for multiple DRM drivers, i.e.
add a mutex and use drmfs_registered as a reference count (also then
don't call the entrypoint init/fini). Or alternatively (and probably
better?), simply do init/fini from the DRM module init.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux