Whamcloud - gitweb
LU-9679 obdclass: don't manage module refs in open/close. 21/37021/3
authorMr NeilBrown <neilb@suse.de>
Sun, 15 Dec 2019 21:29:30 +0000 (08:29 +1100)
committerOleg Drokin <green@whamcloud.com>
Fri, 10 Jan 2020 07:40:45 +0000 (07:40 +0000)
Core Linux code for managing char-devs ensures that the relevant
module is held active while a char-dev is open - see cdev_get()
and cdev_put().
So there is no need for lustre/obd_class to manage the module
ref count as well.

As this is all that obd_class_open and obd_class_close do, those
functions can be removed.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I84b0dc81c830cefc2383f184d12beeb2cfa22404
Reviewed-on: https://review.whamcloud.com/37021
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/class_obd.c

index 703025f..3e70349 100644 (file)
@@ -494,23 +494,6 @@ out:
        RETURN(err);
 } /* class_handle_ioctl */
 
-/*  opening /dev/obd */
-static int obd_class_open(struct inode * inode, struct file * file)
-{
-       ENTRY;
-       try_module_get(THIS_MODULE);
-       RETURN(0);
-}
-
-/*  closing /dev/obd */
-static int obd_class_release(struct inode * inode, struct file * file)
-{
-       ENTRY;
-
-       module_put(THIS_MODULE);
-       RETURN(0);
-}
-
 /* to control /dev/obd */
 static long obd_class_ioctl(struct file *filp, unsigned int cmd,
                            unsigned long arg)
@@ -534,8 +517,6 @@ static long obd_class_ioctl(struct file *filp, unsigned int cmd,
 static struct file_operations obd_psdev_fops = {
        .owner          = THIS_MODULE,
        .unlocked_ioctl = obd_class_ioctl,      /* unlocked_ioctl */
-       .open           = obd_class_open,       /* open */
-       .release        = obd_class_release,    /* release */
 };
 
 /* modules setup */