diff --git a/WHATS_NEW b/WHATS_NEW index 16dc22062..8d483691b 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.00.20 - ============================== + Fix device number handling for 2.6 kernels. Version 2.00.19 - 29 June 2004 ============================== diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index e7e16a78f..c1658b724 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,3 +1,7 @@ +Version 1.00.19 - +============================= + Fix device number handling for 2.6 kernels. + Version 1.00.18 - 20 Jun 2004 ============================= Fix a uuid free in libdm-iface. diff --git a/lib/filters/filter.c b/lib/filters/filter.c index 3d9ea7c08..b03dfdc77 100644 --- a/lib/filters/filter.c +++ b/lib/filters/filter.c @@ -25,7 +25,7 @@ #include #include -#define NUMBER_OF_MAJORS 256 +#define NUMBER_OF_MAJORS 4096 typedef struct { const char *name; @@ -96,6 +96,7 @@ static int *_scan_proc_dev(const char *proc, const struct config_node *cn) int *max_partitions_by_major; char *name; + /* FIXME Make this sparse */ if (!(max_partitions_by_major = dbg_malloc(sizeof(int) * NUMBER_OF_MAJORS))) { log_error("Filter failed to allocate max_partitions_by_major"); diff --git a/lib/filters/filter.h b/lib/filters/filter.h index ba2f97980..92cbc299b 100644 --- a/lib/filters/filter.h +++ b/lib/filters/filter.h @@ -21,7 +21,9 @@ #include #ifdef linux -# include +# define MAJOR(dev) ((dev & 0xfff00) >> 8) +# define MINOR(dev) ((dev & 0xff) | ((dev >> 12) & 0xfff00)) +# define MKDEV(ma,mi) ((mi & 0xff) | (ma << 8) | ((mi & ~0xff) << 12)) #else # define MAJOR(x) major((x)) # define MINOR(x) minor((x)) diff --git a/libdm/ioctl/libdm-compat.h b/libdm/ioctl/libdm-compat.h index ed6e85f29..4c06e7f3a 100644 --- a/libdm/ioctl/libdm-compat.h +++ b/libdm/ioctl/libdm-compat.h @@ -16,9 +16,9 @@ #ifndef _LINUX_LIBDM_COMPAT_H #define _LINUX_LIBDM_COMPAT_H +#include "kdev_t.h" #include #include -#include #include struct dm_task; diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c index b9eec824e..f84c262ed 100644 --- a/libdm/ioctl/libdm-iface.c +++ b/libdm/ioctl/libdm-iface.c @@ -33,8 +33,8 @@ #include #ifdef linux +# include "kdev_t.h" # include -# include # include #else # define MAJOR(x) major((x)) diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c index b7454dc3c..2fad90489 100644 --- a/libdm/libdm-common.c +++ b/libdm/libdm-common.c @@ -17,6 +17,7 @@ #include "libdm-common.h" #include "list.h" #include "log.h" +#include "kdev_t.h" #include #include @@ -27,7 +28,6 @@ #include #include #include -#include #ifdef HAVE_SELINUX # include diff --git a/tools/dmsetup.c b/tools/dmsetup.c index 4af94c9ff..3ea71f41f 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -38,7 +38,7 @@ extern char *optarg; #endif #ifdef linux -# include +# include "kdev_t.h" #else # define MAJOR(x) major((x)) # define MINOR(x) minor((x))