[DRBD-cvs] svn commit by lars - r3028 - branches/drbd-8.0/drbd - fixes for linux 2.6.23 * r3003 | lars | 2007-07-27 15:0

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Mon Aug 27 21:38:52 CEST 2007


Author: lars
Date: 2007-08-27 21:38:47 +0200 (Mon, 27 Aug 2007)
New Revision: 3028

Modified:
   branches/drbd-8.0/drbd/drbd_compat_wrappers.h
   branches/drbd-8.0/drbd/drbd_main.c
Log:
fixes for linux 2.6.23
 * r3003 | lars | 2007-07-27 15:07:19 +0200
   unregister_blkdev is void now; add wrapper for older kernels.


Modified: branches/drbd-8.0/drbd/drbd_compat_wrappers.h
===================================================================
--- branches/drbd-8.0/drbd/drbd_compat_wrappers.h	2007-08-27 19:29:55 UTC (rev 3027)
+++ branches/drbd-8.0/drbd/drbd_compat_wrappers.h	2007-08-27 19:38:47 UTC (rev 3028)
@@ -191,6 +191,17 @@
 		);
 }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+static inline void drbd_unregister_blkdev(unsigned int major, const char *name)
+{
+	int ret = unregister_blkdev(major,name);
+	if (ret)
+		printk(KERN_ERR DEVICE_NAME": unregister of device failed\n");
+}
+#else
+#define drbd_unregister_blkdev unregister_blkdev
+#endif
+
 #ifdef NEED_BACKPORT_OF_ATOMIC_ADD
 
 #if defined(__x86_64__)

Modified: branches/drbd-8.0/drbd/drbd_main.c
===================================================================
--- branches/drbd-8.0/drbd/drbd_main.c	2007-08-27 19:29:55 UTC (rev 3027)
+++ branches/drbd-8.0/drbd/drbd_main.c	2007-08-27 19:38:47 UTC (rev 3028)
@@ -2306,8 +2306,7 @@
 
 	kfree(minor_table);
 
-	if (unregister_blkdev(MAJOR_NR, DEVICE_NAME) != 0)
-		printk(KERN_ERR DEVICE_NAME": unregister of device failed\n");
+	drbd_unregister_blkdev(LANANA_DRBD_MAJOR, DEVICE_NAME);
 
 	printk(KERN_INFO DEVICE_NAME": module cleanup done.\n");
 }



More information about the drbd-cvs mailing list