Skip to contentSkip to conversation

multipath-tools/kpartx - loop support

PATCH In review Bastian Blank 2 participants 3 messages Sep 29, 2005 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 multipath-tools/kpartx - loop support

Hi Christophe

The following patches makes kpartx loop support buildable.

You can also pull this changes from
http://137.250.31.225/rsync/git/linux/storage/multipath-tools.git.

Bastian

Use kernel definition of __kernel_old_dev_t.

---
commit 283cc1fbbd7a212f1f18f1cc2a5cb0c2d3aebd9b
tree 14fc95286dd53aa21a2cd15fedd35f7488f26c45
parent 1d586d3a1a998b64fa27e61777478d8735d4152a
author Bastian Blank <[email protected]> Thu, 29 Sep 2005 14:10:23 +0000 committer Bastian Blank <[email protected]> Thu, 29 Sep 2005 14:10:23 +0000

 kpartx/lopart.c |   11 -----------
 1 files changed, 0 insertions(+), 11 deletions(-)
kpartx/lopart.c +0 -11
@@ -27,17 +27,6 @@
 #include <sys/mman.h>
 #include <sysmacros.h>
 
-#if defined(__hppa__) || defined(__powerpc64__) || defined (__alpha__) \
- || defined (__x86_64__)
-typedef unsigned long __kernel_old_dev_t;
-#elif defined(__powerpc__) || defined(__ia64__)
-typedef unsigned int __kernel_old_dev_t;
-#else
-typedef unsigned short __kernel_old_dev_t;
-#endif
-
-#define dev_t __kernel_old_dev_t
-
 #include <linux/loop.h>
 
 #include "lopart.h"

!-------------------------------------------------------------flip-

Use C99 type uintptr_t.

---
commit 1dc2104b2a9a7db25dceaa37304abf83436813de
tree b81ec33c94cc0f5731bac9fd6eeec6134615c340
parent 283cc1fbbd7a212f1f18f1cc2a5cb0c2d3aebd9b
author Bastian Blank <[email protected]> Thu, 29 Sep 2005 14:11:53 +0000 committer Bastian Blank <[email protected]> Thu, 29 Sep 2005 14:11:53 +0000

 kpartx/lopart.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
kpartx/lopart.c +2 -6
@@ -26,18 +26,14 @@
 #include <sys/stat.h>
 #include <sys/mman.h>
 #include <sysmacros.h>
+#include <stdint.h>
 
 #include <linux/loop.h>
 
 #include "lopart.h"
 #include "xstrncpy.h"
 
-#if !defined (__alpha__) && !defined (__ia64__) && !defined (__x86_64__) \
-        && !defined (__s390x__)
-#define int2ptr(x)	((void *) ((int) x))
-#else
-#define int2ptr(x)	((void *) ((long) x))
-#endif
+#define int2ptr(x)	((void *) ((uintptr_t) x))
 
 static char *
 xstrdup (const char *s)

!-------------------------------------------------------------flip-

Signature · 2 lines
It would seem that evil retreats when forcibly confronted.
		-- Yarnek of Excalbia, "The Savage Curtain", stardate 5906.5
#1 lore raw
Quoted 1 line · Bastian Blank

Use kernel definition of __kernel_old_dev_t.

That only works if your glibc-kernheaders package defines it and not all do, which is why it's there. The story seems to be that that package lags behind the kernel because people don't update glibc immediately every time something is added to the kernel. So while it's OK to remove it for some distributions, you can't remove it upstream.

Alasdair

Signature · 1 line
[email protected]
#2 lore raw
Quoted 5 lines · Alasdair G Kergon
Quoted 1 line · Bastian Blank

Use kernel definition of __kernel_old_dev_t.

That only works if your glibc-kernheaders package defines it and not all do, which is why it's there.

It breaks the rule to not use the libc supplied linux headers anyway. On the otherside, the correct dev_t definition is supplied by linux/types.h for versions which have no selfcontaining linux/loop.h.

Quoted 3 lines

The story seems
to be that that package lags behind the kernel because people don't update glibc immediately every time something is added to the kernel.

The glibc headers are supposed to match the kernel it is built against.

Quoted 2 lines

So while it's OK to remove it for some distributions, you can't remove it upstream.

With the linux/types.h include it should work for the headers from linux

Quoted 1 line

= 1.3.78, it this old enough? Without it seems to be okay for 2.6.

Bastian

Signature · 2 lines
Earth -- mother of the most beautiful women in the universe.
		-- Apollo, "Who Mourns for Adonais?" stardate 3468.1