patch-2.4.0-test4 linux/drivers/block/lvm.c

Next file: linux/drivers/block/md.c
Previous file: linux/drivers/block/ll_rw_blk.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test3/linux/drivers/block/lvm.c linux/drivers/block/lvm.c
@@ -301,6 +301,7 @@
 
 static struct file_operations lvm_chr_fops =
 {
+	owner:		THIS_MODULE,
 	open:		lvm_chr_open,
 	release:	lvm_chr_close,
 	ioctl:		lvm_chr_ioctl,
@@ -517,8 +518,6 @@
 	/* Group special file open */
 	if (VG_CHR(minor) > MAX_VG) return -ENXIO;
 
-	MOD_INC_USE_COUNT;
-
 	lvm_chr_open_count++;
 	return 0;
 } /* lvm_chr_open() */
@@ -743,6 +742,7 @@
 	     "%s -- lvm_chr_close   VG#: %d\n", lvm_name, VG_CHR(minor));
 #endif
 
+	lock_kernel();
 #ifdef LVM_TOTAL_RESET
 	if (lvm_reset_spindown > 0) {
 		lvm_reset_spindown = 0;
@@ -755,10 +755,7 @@
 		lock = 0;	/* release lock */
 		wake_up_interruptible(&lvm_wait);
 	}
-
-#ifdef MODULE
-	if (GET_USE_COUNT(&__this_module) > 0) MOD_DEC_USE_COUNT;
-#endif
+	unlock_kernel();
 
 	return 0;
 } /* lvm_chr_close() */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)