From dcabd4e7e955231a6bb92ce1038e62e5a9b90c5d Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 3 Aug 2015 09:58:33 +1000 Subject: [PATCH] xfsprogs: don't install platform_defs.h platform_defs.h is a generated header file, which causes all kinds of problems when installed on multiarch systems, and requires workarounds in distribution packages. Instead move the small parts of it needed in the installed xfs.h into xfs.h and keep platform_defs.h private to xfsprogs. Signed-off-by: Christoph Hellwig Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- include/Makefile | 4 ++-- include/libxfs.h | 1 + include/linux.h | 1 + include/path.h | 2 +- include/platform_defs.h.in | 27 --------------------------- include/project.h | 1 + include/xfs.h | 28 +++++++++++++++++++++++++++- io/attr.c | 1 - io/bmap.c | 2 +- io/fadvise.c | 1 - io/fiemap.c | 2 +- io/file.c | 1 - io/freeze.c | 1 - io/fsync.c | 2 +- io/getrusage.c | 1 - io/imap.c | 1 - io/init.c | 2 +- io/inject.c | 1 - io/io.h | 2 ++ io/link.c | 1 - io/madvise.c | 1 - io/mincore.c | 1 - io/mmap.c | 1 - io/open.c | 1 - io/parent.c | 1 - io/pread.c | 1 - io/prealloc.c | 1 - io/pwrite.c | 1 - io/readdir.c | 1 - io/resblks.c | 1 - io/seek.c | 1 - io/sendfile.c | 1 - io/shutdown.c | 1 - io/sync.c | 2 +- io/sync_file_range.c | 1 - io/truncate.c | 1 - libhandle/handle.c | 1 + libhandle/jdm.c | 1 + libxcmd/command.c | 2 +- libxcmd/help.c | 2 +- libxcmd/input.c | 2 +- libxcmd/quit.c | 2 +- libxfs/crc32.c | 1 + libxfs/libxfs_priv.h | 1 + libxfs/radix-tree.c | 1 + 45 files changed, 49 insertions(+), 63 deletions(-) diff --git a/include/Makefile b/include/Makefile index 46209cea1..8ffd2f222 100644 --- a/include/Makefile +++ b/include/Makefile @@ -38,12 +38,12 @@ LIBHFILES = libxfs.h \ command.h \ input.h \ path.h \ - project.h + project.h \ + platform_defs.h \ HFILES = handle.h \ jdm.h \ $(PKG_PLATFORM).h \ - platform_defs.h \ xfs.h \ xqm.h \ xfs_arch.h diff --git a/include/libxfs.h b/include/libxfs.h index 1fb2d6dd5..b1604e2e1 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -21,6 +21,7 @@ #include "libxfs_api_defs.h" #include "platform_defs.h" +#include "xfs.h" #include "list.h" #include "hlist.h" diff --git a/include/linux.h b/include/linux.h index cb6298f5d..8804c2d41 100644 --- a/include/linux.h +++ b/include/linux.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/include/path.h b/include/path.h index 58955efa8..46a887e51 100644 --- a/include/path.h +++ b/include/path.h @@ -18,7 +18,7 @@ #ifndef __PATH_H__ #define __PATH_H__ -#include "xfs.h" +#include "platform_defs.h" /* * XFS Filesystem Paths diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in index db6cb2e98..fc7e01abb 100644 --- a/include/platform_defs.h.in +++ b/include/platform_defs.h.in @@ -38,20 +38,6 @@ typedef struct filldir filldir_t; -#if defined(__linux__) -#include -#elif defined(__FreeBSD__) -#include -#elif defined(__FreeBSD_kernel__) -#include -#elif defined(__APPLE__) -#include -#elif defined(__sgi__) || defined(__sgi) -#include -#else -# error unknown platform... have fun porting! -#endif - /* long and pointer must be either 32 bit or 64 bit */ #undef SIZEOF_LONG #undef SIZEOF_CHAR_P @@ -76,19 +62,6 @@ typedef unsigned short umode_t; #endif #include -#ifdef DEBUG -# define ASSERT(EX) assert(EX) -#else -# define ASSERT(EX) ((void) 0) -#endif - -/* - * sparse kernel source annotations - */ -#ifndef __user -#define __user -#endif - #define IRIX_DEV_BITSMAJOR 14 #define IRIX_DEV_BITSMINOR 18 #define IRIX_DEV_MAXMAJ 0x1ff diff --git a/include/project.h b/include/project.h index 63bdffd3e..77ed06b71 100644 --- a/include/project.h +++ b/include/project.h @@ -18,6 +18,7 @@ #ifndef __PROJECT_H__ #define __PROJECT_H__ +#include "platform_defs.h" #include "xfs.h" extern int setprojid(const char *__name, int __fd, prid_t __id); diff --git a/include/xfs.h b/include/xfs.h index e32c4a8db..bc940685e 100644 --- a/include/xfs.h +++ b/include/xfs.h @@ -33,7 +33,33 @@ #ifndef __XFS_H__ #define __XFS_H__ -#include +#if defined(__linux__) +#include +#elif defined(__FreeBSD__) +#include +#elif defined(__FreeBSD_kernel__) +#include +#elif defined(__APPLE__) +#include +#elif defined(__sgi__) || defined(__sgi) +#include +#else +# error unknown platform... have fun porting! +#endif + +#ifdef DEBUG +# define ASSERT(EX) assert(EX) +#else +# define ASSERT(EX) ((void) 0) +#endif + +/* + * sparse kernel source annotations + */ +#ifndef __user +#define __user +#endif + #include #include diff --git a/io/attr.c b/io/attr.c index bc1ab56e5..7cbcc3c88 100644 --- a/io/attr.c +++ b/io/attr.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/bmap.c b/io/bmap.c index 432ddb7fa..cbeed3bb0 100644 --- a/io/bmap.c +++ b/io/bmap.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" +#include "platform_defs.h" #include "command.h" #include "init.h" #include "io.h" diff --git a/io/fadvise.c b/io/fadvise.c index fa586d3e0..d59d1ff28 100644 --- a/io/fadvise.c +++ b/io/fadvise.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/fiemap.c b/io/fiemap.c index 8482c9920..17b38a4fe 100644 --- a/io/fiemap.c +++ b/io/fiemap.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" +#include "platform_defs.h" #include "command.h" #include #include diff --git a/io/file.c b/io/file.c index 91dd38e2f..d4bc4f8fc 100644 --- a/io/file.c +++ b/io/file.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include diff --git a/io/freeze.c b/io/freeze.c index 90f5b664e..3d0d2a4b5 100644 --- a/io/freeze.c +++ b/io/freeze.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/fsync.c b/io/fsync.c index 6c93dffbe..9fe5e2f50 100644 --- a/io/fsync.c +++ b/io/fsync.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" +#include "platform_defs.h" #include "command.h" #include "init.h" #include "io.h" diff --git a/io/getrusage.c b/io/getrusage.c index 28b8453d7..bccf94cbc 100644 --- a/io/getrusage.c +++ b/io/getrusage.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include diff --git a/io/imap.c b/io/imap.c index 7c24bcd33..34901cb9d 100644 --- a/io/imap.c +++ b/io/imap.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/init.c b/io/init.c index 70214f9a2..13f35c40e 100644 --- a/io/init.c +++ b/io/init.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" +#include "platform_defs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/inject.c b/io/inject.c index 23eb4a208..90ccda8c8 100644 --- a/io/inject.c +++ b/io/inject.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/io.h b/io/io.h index db8b5138c..b115e4ad8 100644 --- a/io/io.h +++ b/io/io.h @@ -16,6 +16,8 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "xfs.h" + /* * Read/write patterns (default is always "forward") */ diff --git a/io/link.c b/io/link.c index 7fb81e13f..ccf8e691b 100644 --- a/io/link.c +++ b/io/link.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/madvise.c b/io/madvise.c index b30d28bab..1d8b53cb5 100644 --- a/io/madvise.c +++ b/io/madvise.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include diff --git a/io/mincore.c b/io/mincore.c index 670d4c8d5..9e0d3a620 100644 --- a/io/mincore.c +++ b/io/mincore.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include diff --git a/io/mmap.c b/io/mmap.c index 33747c17d..f26276e52 100644 --- a/io/mmap.c +++ b/io/mmap.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include diff --git a/io/open.c b/io/open.c index 33d9f8dfe..ac5a5e0f3 100644 --- a/io/open.c +++ b/io/open.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/parent.c b/io/parent.c index a374b3e9d..abc3402b3 100644 --- a/io/parent.c +++ b/io/parent.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include "path.h" diff --git a/io/pread.c b/io/pread.c index 9205e34e5..1c77c4134 100644 --- a/io/pread.c +++ b/io/pread.c @@ -17,7 +17,6 @@ */ #include -#include "xfs.h" #include "command.h" #include "input.h" #include diff --git a/io/prealloc.c b/io/prealloc.c index b60d2dc58..713ea7bcb 100644 --- a/io/prealloc.c +++ b/io/prealloc.c @@ -19,7 +19,6 @@ #if defined(HAVE_FALLOCATE) #include #endif -#include "xfs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/pwrite.c b/io/pwrite.c index c9d2b1ac6..10f78e42a 100644 --- a/io/pwrite.c +++ b/io/pwrite.c @@ -17,7 +17,6 @@ */ #include -#include "xfs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/readdir.c b/io/readdir.c index f8b2755dc..7b0edbc61 100644 --- a/io/readdir.c +++ b/io/readdir.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/resblks.c b/io/resblks.c index df032d590..73318ae03 100644 --- a/io/resblks.c +++ b/io/resblks.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/seek.c b/io/seek.c index 39dab61d8..35a369e6a 100644 --- a/io/seek.c +++ b/io/seek.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include diff --git a/io/sendfile.c b/io/sendfile.c index 744b6187f..5c1638ff8 100644 --- a/io/sendfile.c +++ b/io/sendfile.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include diff --git a/io/shutdown.c b/io/shutdown.c index b75278ada..d8507cc78 100644 --- a/io/shutdown.c +++ b/io/shutdown.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/sync.c b/io/sync.c index 0e7b82d91..28e3a15e0 100644 --- a/io/sync.c +++ b/io/sync.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" +#include "platform_defs.h" #include "command.h" #include "init.h" #include "io.h" diff --git a/io/sync_file_range.c b/io/sync_file_range.c index 8e6677359..7e4f3e6da 100644 --- a/io/sync_file_range.c +++ b/io/sync_file_range.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/truncate.c b/io/truncate.c index 5b2ac018b..f2df16834 100644 --- a/io/truncate.c +++ b/io/truncate.c @@ -16,7 +16,6 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/libhandle/handle.c b/libhandle/handle.c index 7313e3b9c..b1c0c1049 100644 --- a/libhandle/handle.c +++ b/libhandle/handle.c @@ -17,6 +17,7 @@ */ #include +#include "platform_defs.h" #include "xfs.h" #include "handle.h" #include "parent.h" diff --git a/libhandle/jdm.c b/libhandle/jdm.c index 13196d145..d8044237b 100644 --- a/libhandle/jdm.c +++ b/libhandle/jdm.c @@ -16,6 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "platform_defs.h" #include "xfs.h" #include "handle.h" #include "jdm.h" diff --git a/libxcmd/command.c b/libxcmd/command.c index 5d0649b70..42a77e997 100644 --- a/libxcmd/command.c +++ b/libxcmd/command.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" +#include "platform_defs.h" #include "command.h" #include "input.h" diff --git a/libxcmd/help.c b/libxcmd/help.c index 023b83088..fad0ab98f 100644 --- a/libxcmd/help.c +++ b/libxcmd/help.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" +#include "platform_defs.h" #include "command.h" static cmdinfo_t help_cmd; diff --git a/libxcmd/input.c b/libxcmd/input.c index 966a7ff88..c505ab3d4 100644 --- a/libxcmd/input.c +++ b/libxcmd/input.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" +#include "platform_defs.h" #include "input.h" #include #include diff --git a/libxcmd/quit.c b/libxcmd/quit.c index 0a2dd409a..0183b8f78 100644 --- a/libxcmd/quit.c +++ b/libxcmd/quit.c @@ -16,7 +16,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "xfs.h" +#include "platform_defs.h" #include "command.h" static cmdinfo_t quit_cmd; diff --git a/libxfs/crc32.c b/libxfs/crc32.c index b2c7ec071..783d62e9a 100644 --- a/libxfs/crc32.c +++ b/libxfs/crc32.c @@ -34,6 +34,7 @@ */ #include "platform_defs.h" +#include "xfs.h" #include "xfs_arch.h" #include "crc32defs.h" diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index 7a29fd74e..1b017642e 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -59,6 +59,7 @@ #include "libxfs_api_defs.h" #include "platform_defs.h" +#include "xfs.h" #include "list.h" #include "hlist.h" diff --git a/libxfs/radix-tree.c b/libxfs/radix-tree.c index 9e395be15..4d44ab4d7 100644 --- a/libxfs/radix-tree.c +++ b/libxfs/radix-tree.c @@ -19,6 +19,7 @@ */ #include "platform_defs.h" +#include "xfs.h" #include "radix-tree.h" #ifndef ARRAY_SIZE -- 2.47.2