From dcca94e3d013727d74fe0c017207769cddbcc78a Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 1 Jul 2004 15:14:28 +0000 Subject: [PATCH] Fix device number handling for 2.6 kernels. --- VERSION | 2 +- WHATS_NEW | 4 ++++ dmsetup/dmsetup.c | 2 +- include/kdev_t.h | 22 ++++++++++++++++++++++ lib/ioctl/libdm-compat.h | 2 +- lib/ioctl/libdm-iface.c | 2 +- lib/libdm-common.c | 2 +- 7 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 include/kdev_t.h diff --git a/VERSION b/VERSION index c407ef6..cba4c81 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.00.18-cvs (2004-06-20) +1.00.19-cvs (2004-07-01) diff --git a/WHATS_NEW b/WHATS_NEW index e7e16a7..c1658b7 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -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/dmsetup/dmsetup.c b/dmsetup/dmsetup.c index 4af94c9..3ea71f4 100644 --- a/dmsetup/dmsetup.c +++ b/dmsetup/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)) diff --git a/include/kdev_t.h b/include/kdev_t.h new file mode 100644 index 0000000..e5433d3 --- /dev/null +++ b/include/kdev_t.h @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2004 Red Hat, Inc. All rights reserved. + * + * This file is part of the device-mapper userspace tools. + * + * This copyrighted material is made available to anyone wishing to use, + * modify, copy, or redistribute it subject to the terms and conditions + * of the GNU Lesser General Public License v.2.1. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _LVM_KDEV_H +#define _LVM_KDEV_H + +#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)) + +#endif diff --git a/lib/ioctl/libdm-compat.h b/lib/ioctl/libdm-compat.h index ed6e85f..4c06e7f 100644 --- a/lib/ioctl/libdm-compat.h +++ b/lib/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/lib/ioctl/libdm-iface.c b/lib/ioctl/libdm-iface.c index b9eec82..f84c262 100644 --- a/lib/ioctl/libdm-iface.c +++ b/lib/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/lib/libdm-common.c b/lib/libdm-common.c index b7454dc..2fad904 100644 --- a/lib/libdm-common.c +++ b/lib/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 -- 2.43.5