patch-2.4.0-test2 linux/drivers/block/xd.c

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

diff -u --recursive --new-file v2.4.0-test1/linux/drivers/block/xd.c linux/drivers/block/xd.c
@@ -258,20 +258,19 @@
 {
 	int dev = DEVICE_NR(inode->i_rdev);
 
+	MOD_INC_USE_COUNT;
+
 	if (dev < xd_drives) {
 		while (!xd_valid[dev])
 			sleep_on(&xd_wait_open);
 
-#ifdef MODULE
-		MOD_INC_USE_COUNT;
-#endif /* MODULE */
-
 		xd_access[dev]++;
 
 		return (0);
 	}
-	else
-		return -ENXIO;
+
+	MOD_DEC_USE_COUNT;
+	return -ENXIO;
 }
 
 /* do_xd_request: handle an incoming request */

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