diff options
author | Ned Bass <[email protected]> | 2014-11-14 10:18:05 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-11-19 10:35:12 -0800 |
commit | 52479ecf58fa89190e384edcf838fecccc786af5 (patch) | |
tree | 6adb263086d8f7cc4ced0c81f217cb67dfb45d09 | |
parent | 8d9a23e82cea5d897e9357d569ef364106703d5a (diff) |
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 <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #411
-rw-r--r-- | include/linux/wait_compat.h | 1 | ||||
-rw-r--r-- | include/sys/types.h | 12 | ||||
-rw-r--r-- | module/spl/spl-generic.c | 1 | ||||
-rw-r--r-- | module/spl/spl-kmem.c | 2 | ||||
-rw-r--r-- | module/spl/spl-vnode.c | 1 | ||||
-rw-r--r-- | module/spl/spl-zlib.c | 1 | ||||
-rw-r--r-- | module/splat/splat-atomic.c | 1 | ||||
-rw-r--r-- | module/splat/splat-ctl.c | 15 | ||||
-rw-r--r-- | module/splat/splat-generic.c | 1 | ||||
-rw-r--r-- | module/splat/splat-linux.c | 1 | ||||
-rw-r--r-- | module/splat/splat-mutex.c | 2 | ||||
-rw-r--r-- | module/splat/splat-rwlock.c | 4 | ||||
-rw-r--r-- | module/splat/splat-taskq.c | 5 | ||||
-rw-r--r-- | module/splat/splat-thread.c | 2 | ||||
-rw-r--r-- | module/splat/splat-time.c | 1 |
15 files changed, 28 insertions, 22 deletions
diff --git a/include/linux/wait_compat.h b/include/linux/wait_compat.h index 66f9a9a61..d8cd09b9e 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 <linux/sched.h> #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 b7b8b7bfc..3b3a42ede 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -28,18 +28,6 @@ #include <linux/types.h> #include <sys/sysmacros.h> -#include <linux/file_compat.h> -#include <linux/list_compat.h> -#include <linux/bitops_compat.h> -#include <linux/module_compat.h> -#include <linux/proc_compat.h> -#include <linux/math64_compat.h> -#include <linux/zlib_compat.h> -#include <linux/mm_compat.h> -#include <linux/delay.h> -#include <linux/wait_compat.h> -#include <linux/uaccess.h> - #ifndef ULLONG_MAX #define ULLONG_MAX (~0ULL) #endif diff --git a/module/spl/spl-generic.c b/module/spl/spl-generic.c index ecfb663de..803f03a85 100644 --- a/module/spl/spl-generic.c +++ b/module/spl/spl-generic.c @@ -39,6 +39,7 @@ #include <sys/kstat.h> #include <sys/file.h> #include <linux/kmod.h> +#include <linux/math64_compat.h> #include <linux/proc_compat.h> 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 37849f504..502f5365b 100644 --- a/module/spl/spl-kmem.c +++ b/module/spl/spl-kmem.c @@ -25,6 +25,8 @@ \*****************************************************************************/ #include <sys/kmem.h> +#include <linux/mm_compat.h> +#include <linux/wait_compat.h> /* * 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 cac0aaf29..e5db0ec2c 100644 --- a/module/spl/spl-vnode.c +++ b/module/spl/spl-vnode.c @@ -27,6 +27,7 @@ #include <sys/cred.h> #include <sys/vnode.h> #include <linux/falloc.h> +#include <linux/file_compat.h> vnode_t *rootdir = (vnode_t *)0xabcd1234; EXPORT_SYMBOL(rootdir); diff --git a/module/spl/spl-zlib.c b/module/spl/spl-zlib.c index 2b8aab865..2967b03ce 100644 --- a/module/spl/spl-zlib.c +++ b/module/spl/spl-zlib.c @@ -55,6 +55,7 @@ #include <sys/kmem.h> #include <sys/zmod.h> +#include <linux/zlib_compat.h> static spl_kmem_cache_t *zlib_workspace_cache; diff --git a/module/splat/splat-atomic.c b/module/splat/splat-atomic.c index 7a1bd859d..a270dc42f 100644 --- a/module/splat/splat-atomic.c +++ b/module/splat/splat-atomic.c @@ -27,6 +27,7 @@ #include <sys/atomic.h> #include <sys/thread.h> #include <sys/mutex.h> +#include <linux/mm_compat.h> #include <linux/slab.h> #include "splat-internal.h" diff --git a/module/splat/splat-ctl.c b/module/splat/splat-ctl.c index 46bc6d1a6..bedf5d2d8 100644 --- a/module/splat/splat-ctl.c +++ b/module/splat/splat-ctl.c @@ -43,16 +43,17 @@ * of regression tests or particular tests. \*****************************************************************************/ -#include <linux/module.h> -#include <linux/slab.h> -#include <linux/vmalloc.h> +#include <sys/debug.h> +#include <sys/mutex.h> +#include <sys/types.h> #include <linux/cdev.h> #include <linux/fs.h> -#include <linux/uaccess.h> #include <linux/miscdevice.h> -#include <sys/types.h> -#include <sys/debug.h> -#include <sys/mutex.h> +#include <linux/module.h> +#include <linux/module_compat.h> +#include <linux/slab.h> +#include <linux/uaccess.h> +#include <linux/vmalloc.h> #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 ad03651d0..3f8119b1e 100644 --- a/module/splat/splat-generic.c +++ b/module/splat/splat-generic.c @@ -25,6 +25,7 @@ \*****************************************************************************/ #include <sys/sunddi.h> +#include <linux/math64_compat.h> #include "splat-internal.h" #define SPLAT_GENERIC_NAME "generic" diff --git a/module/splat/splat-linux.c b/module/splat/splat-linux.c index 880b30152..3652267f9 100644 --- a/module/splat/splat-linux.c +++ b/module/splat/splat-linux.c @@ -24,6 +24,7 @@ \*****************************************************************************/ #include <sys/kmem.h> +#include <linux/mm_compat.h> #include "splat-internal.h" #define SPLAT_LINUX_NAME "linux" diff --git a/module/splat/splat-mutex.c b/module/splat/splat-mutex.c index cc1d36869..909d730cb 100644 --- a/module/splat/splat-mutex.c +++ b/module/splat/splat-mutex.c @@ -26,6 +26,8 @@ #include <sys/mutex.h> #include <sys/taskq.h> +#include <linux/delay.h> +#include <linux/mm_compat.h> #include "splat-internal.h" #define SPLAT_MUTEX_NAME "mutex" diff --git a/module/splat/splat-rwlock.c b/module/splat/splat-rwlock.c index 6faf7d24e..6c623792e 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 <sys/random.h> #include <sys/rwlock.h> #include <sys/taskq.h> -#include <sys/random.h> +#include <linux/delay.h> +#include <linux/mm_compat.h> #include "splat-internal.h" #define SPLAT_RWLOCK_NAME "rwlock" diff --git a/module/splat/splat-taskq.c b/module/splat/splat-taskq.c index 33e49b2f1..6c2b43579 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 <sys/taskq.h> -#include <sys/random.h> #include <sys/kmem.h> +#include <sys/random.h> +#include <sys/taskq.h> +#include <linux/delay.h> #include "splat-internal.h" #define SPLAT_TASKQ_NAME "taskq" diff --git a/module/splat/splat-thread.c b/module/splat/splat-thread.c index e55acd0c8..3255e37e5 100644 --- a/module/splat/splat-thread.c +++ b/module/splat/splat-thread.c @@ -26,6 +26,8 @@ #include <sys/thread.h> #include <sys/random.h> +#include <linux/delay.h> +#include <linux/mm_compat.h> #include <linux/slab.h> #include "splat-internal.h" diff --git a/module/splat/splat-time.c b/module/splat/splat-time.c index cd513c93f..b4e94c866 100644 --- a/module/splat/splat-time.c +++ b/module/splat/splat-time.c @@ -25,6 +25,7 @@ \*****************************************************************************/ #include <sys/time.h> +#include <linux/mm_compat.h> #include <linux/slab.h> #include "splat-internal.h" |