[DRBD-cvs] drbd by phil; It loads and unloads now on Linux-2.6. (...

drbd-user@lists.linbit.com drbd-user@lists.linbit.com
Fri, 30 Jan 2004 20:44:57 +0100 (CET)


DRBD CVS committal

Author  : phil
Module  : drbd

Dir     : drbd/drbd


Modified Files:
      Tag: rel-0_7-branch
	drbd_main.c 


Log Message:
It loads and unloads now on Linux-2.6. (And devfs entries gets
registered and unregistered). 

===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/drbd_main.c,v
retrieving revision 1.73.2.115
retrieving revision 1.73.2.116
diff -u -3 -r1.73.2.115 -r1.73.2.116
--- drbd_main.c	27 Jan 2004 15:51:36 -0000	1.73.2.115
+++ drbd_main.c	30 Jan 2004 19:44:52 -0000	1.73.2.116
@@ -1173,7 +1173,7 @@
 			if (*q) blk_put_queue(*q);
 			*q = NULL;
 
-			if (mdev->this_bdev) bd_release(mdev->this_bdev);
+			if (mdev->this_bdev) bdput(mdev->this_bdev);
 )
 
 			tl_cleanup(mdev);
@@ -1257,7 +1257,7 @@
 		goto Enomem;
 #else
 
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) && defined(CONFIG_DEVFS_FS)
+#ifdef CONFIG_DEVFS_FS
 	devfs_mk_dir(DEVICE_NAME);
 #endif
 
@@ -1415,14 +1415,6 @@
 {
 	int i;
 
-#ifdef CONFIG_DEVFS_FS
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-	devfs_unregister(devfs_handle);
-# else
-	devfs_remove(DEVICE_NAME);
-# endif
-#endif
-
 #warning "FIXME increase module refcount with each setup device"
 	/* then you need to tear down all devices
 	 * before you can remove the module */
@@ -1455,6 +1447,14 @@
 #endif
 
 	drbd_cleanup();
+
+#ifdef CONFIG_DEVFS_FS
+# if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+	devfs_unregister(devfs_handle);
+# else
+	devfs_remove(DEVICE_NAME);
+# endif
+#endif
 }
 
 void drbd_free_ll_dev(drbd_dev *mdev)