[DRBD-cvs] svn commit by phil - r2381 - in branches/drbd-0.7: drbd drbd/linux scripts - More stuff to gracefully fade out the DEVFS support

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Wed Aug 23 12:10:10 CEST 2006


Author: phil
Date: 2006-08-23 12:10:08 +0200 (Wed, 23 Aug 2006)
New Revision: 2381

Modified:
   branches/drbd-0.7/drbd/drbd_int.h
   branches/drbd-0.7/drbd/drbd_main.c
   branches/drbd-0.7/drbd/linux/drbd_config.h
   branches/drbd-0.7/scripts/adjust_drbd_config_h.sh
Log:
More stuff to gracefully fade out the DEVFS support


Modified: branches/drbd-0.7/drbd/drbd_int.h
===================================================================
--- branches/drbd-0.7/drbd/drbd_int.h	2006-08-23 09:56:05 UTC (rev 2380)
+++ branches/drbd-0.7/drbd/drbd_int.h	2006-08-23 10:10:08 UTC (rev 2381)
@@ -73,7 +73,7 @@
 extern int major_nr;
 extern int use_nbd_major;
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#ifndef NO_MORE_DEV_FS
 // use_nbd_major ? "nbd" : "drbd";
 extern char* drbd_devfs_name;
 #endif

Modified: branches/drbd-0.7/drbd/drbd_main.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_main.c	2006-08-23 09:56:05 UTC (rev 2380)
+++ branches/drbd-0.7/drbd/drbd_main.c	2006-08-23 10:10:08 UTC (rev 2381)
@@ -49,7 +49,7 @@
 #include <linux/mm_inline.h>
 #endif
 #include <linux/slab.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#ifndef NO_MORE_DEV_FS
 #include <linux/devfs_fs_kernel.h>
 #endif
 
@@ -146,7 +146,7 @@
 #endif
 int disable_bd_claim = 0;
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#ifndef NO_MORE_DEV_FS
 // devfs name
 char* drbd_devfs_name = "drbd";
 #endif
@@ -1698,7 +1698,7 @@
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
 	devfs_unregister(devfs_handle);
 #else
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#ifndef NO_MORE_DEV_FS
 	devfs_remove(drbd_devfs_name);
 #endif
 #endif
@@ -1774,7 +1774,7 @@
 		return err;
 	}
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#ifndef NO_MORE_DEV_FS
 	drbd_devfs_name = (major_nr == NBD_MAJOR) ? "nbd" : "drbd";
 #endif
 
@@ -1798,7 +1798,7 @@
 	if (unlikely(!drbd_blocksizes)) goto Enomem;
 #else
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#ifndef NO_MORE_DEV_FS
 	devfs_mk_dir(drbd_devfs_name);
 #endif
 
@@ -1823,7 +1823,7 @@
 		disk->first_minor = i;
 		disk->fops = &drbd_ops;
 		sprintf(disk->disk_name, DEVICE_NAME "%d", i);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#ifndef NO_MORE_DEV_FS
 		sprintf(disk->devfs_name, "%s/%d", drbd_devfs_name, i);
 #endif
 		disk->private_data = mdev;

Modified: branches/drbd-0.7/drbd/linux/drbd_config.h
===================================================================
--- branches/drbd-0.7/drbd/linux/drbd_config.h	2006-08-23 09:56:05 UTC (rev 2380)
+++ branches/drbd-0.7/drbd/linux/drbd_config.h	2006-08-23 10:10:08 UTC (rev 2381)
@@ -69,4 +69,6 @@
 // but more recent kernels define it in arch/um/include/mem.h
 #define HAVE_UML_TO_VIRT
 
+#define NO_MORE_DEV_FS
+
 #endif

Modified: branches/drbd-0.7/scripts/adjust_drbd_config_h.sh
===================================================================
--- branches/drbd-0.7/scripts/adjust_drbd_config_h.sh	2006-08-23 09:56:05 UTC (rev 2380)
+++ branches/drbd-0.7/scripts/adjust_drbd_config_h.sh	2006-08-23 10:10:08 UTC (rev 2381)
@@ -80,6 +80,7 @@
   else
     have_mm_inline_h=0
   fi
+    no_more_dev_fs=0
 else
     # 2.6. kernel. just leave it alone...
     need_sighand_hack=0
@@ -87,6 +88,7 @@
     need_RH_2_4_18_hack=0
     have_find_next_bit=0
     have_mm_inline_h=0
+    no_more_dev_fs=1
 fi
 
 test -e ./linux/drbd_config.h.orig || cp ./linux/drbd_config.h{,.orig}
@@ -101,7 +103,9 @@
  s{.*(#define HAVE_FIND_NEXT_BIT.*)}
   { ( $have_find_next_bit ? '' : '//' ) . \$1}e;
  s{.*(#define HAVE_MM_INLINE_H.*)}
-  { ( $have_mm_inline_h ? '' : '//' ) . \$1}e;" \
+  { ( $have_mm_inline_h ? '' : '//' ) . \$1}e;
+ s{.*(#define NO_MORE_DEV_FS.*)}
+  { ( $no_more_dev_fs ? '' : '//' ) . \$1}e;" \
 	  < ./linux/drbd_config.h \
 	  > ./linux/drbd_config.h.new
 



More information about the drbd-cvs mailing list