While working on the upstream client Greg pointed out the
current why we handle libcfs module loading with psdev is
very racy. This patch removes the possible race.
Change-Id: Ic86aa9b0d426cc53a239ae81fc92db2d5a2b5c60
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: http://review.whamcloud.com/18964
Reviewed-by: Frank Zago <fzago@cray.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
-static int
-libcfs_psdev_open(struct inode * inode, struct file * file)
-{
- if (!inode)
- return -EINVAL;
-
- try_module_get(THIS_MODULE);
- return 0;
-}
-
-/* called when closing /dev/device */
-static int
-libcfs_psdev_release(struct inode * inode, struct file * file)
-{
- if (!inode)
- return -EINVAL;
-
- module_put(THIS_MODULE);
- return 0;
-}
-
static long
libcfs_psdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
static long
libcfs_psdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
}
static struct file_operations libcfs_fops = {
}
static struct file_operations libcfs_fops = {
.unlocked_ioctl = libcfs_psdev_ioctl,
.unlocked_ioctl = libcfs_psdev_ioctl,
- .open = libcfs_psdev_open,
- .release = libcfs_psdev_release
};
struct miscdevice libcfs_dev = {
};
struct miscdevice libcfs_dev = {