From: Ned Bass Date: Fri, 14 Nov 2014 18:18:05 +0000 (-0800) Subject: Remove compat includes from sys/types.h X-Git-Tag: spl-0.7.12~214 X-Git-Url: https://git.proxmox.com/?p=mirror_spl.git;a=commitdiff_plain;h=52479ecf58fa89190e384edcf838fecccc786af5 Remove compat includes from sys/types.h Don't include the compatibility code in linux/*_compat.h in the public header sys/types.h. This causes problems when an external code base includes the ZFS headers and has its own conflicting compatibility code. Lustre, in particular, defined SHRINK_STOP for compatibility with pre-3.12 kernels in a way that conflicted with the SPL's definition. Because Lustre ZFS OSD includes ZFS headers it fails to build due to a '"SHRINK_STOP" redefined' compiler warning. To avoid such conflicts only include the compat headers from .c files or private headers. Also, for consistency, include sys/*.h before linux/*.h then sort by header name. Signed-off-by: Ned Bass Signed-off-by: Brian Behlendorf Closes #411 --- diff --git a/include/linux/wait_compat.h b/include/linux/wait_compat.h index 66f9a9a..d8cd09b 100644 --- a/include/linux/wait_compat.h +++ b/include/linux/wait_compat.h @@ -25,6 +25,7 @@ #ifndef _SPL_WAIT_COMPAT_H #define _SPL_WAIT_COMPAT_H +#include #ifndef HAVE_WAIT_ON_BIT_ACTION # define spl_wait_on_bit(word, bit, mode) wait_on_bit(word, bit, mode) diff --git a/include/sys/types.h b/include/sys/types.h index b7b8b7b..3b3a42e 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -28,18 +28,6 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #ifndef ULLONG_MAX #define ULLONG_MAX (~0ULL) #endif diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c index ecfb663..803f03a 100644 --- a/module/spl/spl-generic.c +++ b/module/spl/spl-generic.c @@ -39,6 +39,7 @@ #include #include #include +#include #include char spl_version[32] = "SPL v" SPL_META_VERSION "-" SPL_META_RELEASE; diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c index 37849f5..502f536 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -25,6 +25,8 @@ \*****************************************************************************/ #include +#include +#include /* * Within the scope of spl-kmem.c file the kmem_cache_* definitions diff --git a/module/spl/spl-vnode.c b/module/spl/spl-vnode.c index cac0aaf..e5db0ec 100644 --- a/module/spl/spl-vnode.c +++ b/module/spl/spl-vnode.c @@ -27,6 +27,7 @@ #include #include #include +#include vnode_t *rootdir = (vnode_t *)0xabcd1234; EXPORT_SYMBOL(rootdir); diff --git a/module/spl/spl-zlib.c b/module/spl/spl-zlib.c index 2b8aab8..2967b03 100644 --- a/module/spl/spl-zlib.c +++ b/module/spl/spl-zlib.c @@ -55,6 +55,7 @@ #include #include +#include static spl_kmem_cache_t *zlib_workspace_cache; diff --git a/module/splat/splat-atomic.c b/module/splat/splat-atomic.c index 7a1bd85..a270dc4 100644 --- a/module/splat/splat-atomic.c +++ b/module/splat/splat-atomic.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include "splat-internal.h" diff --git a/module/splat/splat-ctl.c b/module/splat/splat-ctl.c index 46bc6d1..bedf5d2 100644 --- a/module/splat/splat-ctl.c +++ b/module/splat/splat-ctl.c @@ -43,16 +43,17 @@ * of regression tests or particular tests. \*****************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include -#include #include -#include -#include -#include +#include +#include +#include +#include +#include #include "splat-internal.h" static struct list_head splat_module_list; diff --git a/module/splat/splat-generic.c b/module/splat/splat-generic.c index ad03651..3f8119b 100644 --- a/module/splat/splat-generic.c +++ b/module/splat/splat-generic.c @@ -25,6 +25,7 @@ \*****************************************************************************/ #include +#include #include "splat-internal.h" #define SPLAT_GENERIC_NAME "generic" diff --git a/module/splat/splat-linux.c b/module/splat/splat-linux.c index 880b301..3652267 100644 --- a/module/splat/splat-linux.c +++ b/module/splat/splat-linux.c @@ -24,6 +24,7 @@ \*****************************************************************************/ #include +#include #include "splat-internal.h" #define SPLAT_LINUX_NAME "linux" diff --git a/module/splat/splat-mutex.c b/module/splat/splat-mutex.c index cc1d368..909d730 100644 --- a/module/splat/splat-mutex.c +++ b/module/splat/splat-mutex.c @@ -26,6 +26,8 @@ #include #include +#include +#include #include "splat-internal.h" #define SPLAT_MUTEX_NAME "mutex" diff --git a/module/splat/splat-rwlock.c b/module/splat/splat-rwlock.c index 6faf7d2..6c62379 100644 --- a/module/splat/splat-rwlock.c +++ b/module/splat/splat-rwlock.c @@ -24,9 +24,11 @@ * Solaris Porting LAyer Tests (SPLAT) Read/Writer Lock Tests. \*****************************************************************************/ +#include #include #include -#include +#include +#include #include "splat-internal.h" #define SPLAT_RWLOCK_NAME "rwlock" diff --git a/module/splat/splat-taskq.c b/module/splat/splat-taskq.c index 33e49b2..6c2b435 100644 --- a/module/splat/splat-taskq.c +++ b/module/splat/splat-taskq.c @@ -24,9 +24,10 @@ * Solaris Porting LAyer Tests (SPLAT) Task Queue Tests. \*****************************************************************************/ -#include -#include #include +#include +#include +#include #include "splat-internal.h" #define SPLAT_TASKQ_NAME "taskq" diff --git a/module/splat/splat-thread.c b/module/splat/splat-thread.c index e55acd0..3255e37 100644 --- a/module/splat/splat-thread.c +++ b/module/splat/splat-thread.c @@ -26,6 +26,8 @@ #include #include +#include +#include #include #include "splat-internal.h" diff --git a/module/splat/splat-time.c b/module/splat/splat-time.c index cd513c9..b4e94c8 100644 --- a/module/splat/splat-time.c +++ b/module/splat/splat-time.c @@ -25,6 +25,7 @@ \*****************************************************************************/ #include +#include #include #include "splat-internal.h"