From 88d52b16ce4df1113ccfd902675d86c395603043 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 7 Nov 2007 21:13:59 +0100 Subject: [PATCH] mount: cleanup KERNEL_VERSION, remove my_dev_t.h Signed-off-by: Karel Zak --- mount/Makefile.am | 2 +- mount/loop.h | 16 ++++++++++++++-- mount/my_dev_t.h | 20 -------------------- 3 files changed, 15 insertions(+), 23 deletions(-) delete mode 100644 mount/my_dev_t.h diff --git a/mount/Makefile.am b/mount/Makefile.am index 46bcb5ab..45674faf 100644 --- a/mount/Makefile.am +++ b/mount/Makefile.am @@ -8,7 +8,7 @@ man_MANS = fstab.5 mount.8 swapoff.8 swapon.8 umount.8 losetup.8 utils_common = sundries.c xmalloc.c realpath.c fsprobe.c -headers_common = fstab.h linux_fs.h mount_mntent.h mount_constants.h my_dev_t.h \ +headers_common = fstab.h linux_fs.h mount_mntent.h mount_constants.h \ mount_paths.h lomount.h fsprobe.h realpath.h xmalloc.h \ getusername.h loop.h sundries.h diff --git a/mount/loop.h b/mount/loop.h index 951a5d18..5e878289 100644 --- a/mount/loop.h +++ b/mount/loop.h @@ -1,3 +1,15 @@ +#ifndef MNT_LOOP_H +#define MNT_LOOP_H + +#include +#include "linux_version.h" + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68) +#define my_dev_t __kernel_dev_t +#else +#define my_dev_t __kernel_old_dev_t +#endif + #define LO_CRYPT_NONE 0 #define LO_CRYPT_XOR 1 #define LO_CRYPT_DES 2 @@ -13,8 +25,6 @@ #define LO_NAME_SIZE 64 #define LO_KEY_SIZE 32 -#include "my_dev_t.h" - struct loop_info { int lo_number; my_dev_t lo_device; @@ -49,3 +59,5 @@ struct loop_info64 { unsigned char lo_encrypt_key[LO_KEY_SIZE]; unsigned long long lo_init[2]; }; + +#endif /* MNT_LOOP_H */ diff --git a/mount/my_dev_t.h b/mount/my_dev_t.h deleted file mode 100644 index 11825e27..00000000 --- a/mount/my_dev_t.h +++ /dev/null @@ -1,20 +0,0 @@ -/* silliness to get dev_t defined as the kernel defines it */ -/* glibc uses a different dev_t */ - -#include -#include - -#ifndef KERNEL_VERSION -#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -#endif - -#if LINUX_VERSION_CODE < KERNEL_VERSION(1,3,78) -/* for i386 - alpha uses unsigned int */ -#define my_dev_t unsigned short -#else -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68) -#define my_dev_t __kernel_dev_t -#else -#define my_dev_t __kernel_old_dev_t -#endif -#endif -- 2.39.5