From 88fca201aca752cbb7a981e1fe1b2a875cc29833 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sat, 22 Aug 2009 13:16:14 -0400 Subject: [PATCH] Move declaration of FS_IOC_FIEMAP ioctl to fiemap.h This helps e4defrag compile on systems where the system header files don't yet define FS_IOC_FIEMAP. Signed-off-by: "Theodore Ts'o" --- lib/ext2fs/fiemap.h | 4 ++++ misc/e4defrag.c | 2 +- misc/filefrag.c | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ext2fs/fiemap.h b/lib/ext2fs/fiemap.h index 934e22d..0696729 100644 --- a/lib/ext2fs/fiemap.h +++ b/lib/ext2fs/fiemap.h @@ -36,6 +36,10 @@ struct fiemap { struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */ }; +#ifndef FS_IOC_FIEMAP +#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap) +#endif + #define FIEMAP_MAX_OFFSET (~0ULL) #define FIEMAP_FLAG_SYNC 0x00000001 /* sync file data before map */ diff --git a/misc/e4defrag.c b/misc/e4defrag.c index 4c83fa3..4451a63 100644 --- a/misc/e4defrag.c +++ b/misc/e4defrag.c @@ -34,8 +34,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/misc/filefrag.c b/misc/filefrag.c index eed2b86..66a09e7 100644 --- a/misc/filefrag.c +++ b/misc/filefrag.c @@ -54,7 +54,6 @@ unsigned long long filesize; #define FIBMAP _IO(0x00, 1) /* bmap access */ #define FIGETBSZ _IO(0x00, 2) /* get the block size used for bmap */ -#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap) #define EXT4_EXTENTS_FL 0x00080000 /* Inode uses extents */ #define EXT3_IOC_GETFLAGS _IOR('f', 1, long) -- 1.8.3.1