SOURCES: drbd-nodevfs.patch (NEW) - no more devfs in 2.6.18; patch...

zbyniu zbyniu at pld-linux.org
Sat Oct 14 02:21:40 CEST 2006


Author: zbyniu                       Date: Sat Oct 14 00:21:40 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- no more devfs in 2.6.18; patch from drbd svn

---- Files affected:
SOURCES:
   drbd-nodevfs.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/drbd-nodevfs.patch
diff -u /dev/null SOURCES/drbd-nodevfs.patch:1.1
--- /dev/null	Sat Oct 14 02:21:40 2006
+++ SOURCES/drbd-nodevfs.patch	Sat Oct 14 02:21:35 2006
@@ -0,0 +1,83 @@
+Index: drbd/drbd_main.c
+===================================================================
+--- drbd/drbd_main.c	(revision 2372)
++++ drbd/drbd_main.c	(revision 2373)
+@@ -49,7 +49,9 @@
+ #include <linux/mm_inline.h>
+ #endif
+ #include <linux/slab.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+ #include <linux/devfs_fs_kernel.h>
++#endif
+ 
+ #define __KERNEL_SYSCALLS__
+ #include <linux/unistd.h>
+@@ -144,10 +146,11 @@
+ #endif
+ int disable_bd_claim = 0;
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+ // devfs name
+ char* drbd_devfs_name = "drbd";
++#endif
+ 
+-
+ // global panic flag
+ volatile int drbd_did_panic = 0;
+ 
+@@ -1695,8 +1698,10 @@
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+ 	devfs_unregister(devfs_handle);
+ #else
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+ 	devfs_remove(drbd_devfs_name);
+ #endif
++#endif
+ 
+ 	if (unregister_blkdev(MAJOR_NR, DEVICE_NAME) != 0)
+ 		printk(KERN_ERR DEVICE_NAME": unregister of device failed\n");
+@@ -1769,7 +1774,9 @@
+ 		return err;
+ 	}
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+ 	drbd_devfs_name = (major_nr == NBD_MAJOR) ? "nbd" : "drbd";
++#endif
+ 
+ 	/*
+ 	 * allocate all necessary structs
+@@ -1791,7 +1798,9 @@
+ 	if (unlikely(!drbd_blocksizes)) goto Enomem;
+ #else
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+ 	devfs_mk_dir(drbd_devfs_name);
++#endif
+ 
+ 	for (i = 0; i < minor_count; i++) {
+ 		drbd_dev    *mdev = drbd_conf + i;
+@@ -1814,7 +1823,9 @@
+ 		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)
+ 		sprintf(disk->devfs_name, "%s/%d", drbd_devfs_name, i);
++#endif
+ 		disk->private_data = mdev;
+ 		add_disk(disk);
+ 
+Index: drbd/drbd_int.h
+===================================================================
+--- drbd/drbd_int.h	(revision 2372)
++++ drbd/drbd_int.h	(revision 2373)
+@@ -73,8 +73,10 @@
+ extern int major_nr;
+ extern int use_nbd_major;
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+ // use_nbd_major ? "nbd" : "drbd";
+ extern char* drbd_devfs_name;
++#endif
+ 
+ #include <linux/major.h>
+ #ifdef DRBD_MAJOR
================================================================


More information about the pld-cvs-commit mailing list