From: Mr NeilBrown Date: Sun, 15 Dec 2019 21:29:30 +0000 (+1100) Subject: LU-9679 obdclass: don't manage module refs in open/close. X-Git-Tag: 2.13.51~21 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=b42d7290afed000ffa7584265ced182a9c738750 LU-9679 obdclass: don't manage module refs in open/close. 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 Change-Id: I84b0dc81c830cefc2383f184d12beeb2cfa22404 Reviewed-on: https://review.whamcloud.com/37021 Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin --- diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index 703025f..3e70349 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -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 */