]> git.proxmox.com Git - mirror_spl.git/commitdiff
Remove compat includes from sys/types.h
authorNed Bass <bass6@llnl.gov>
Fri, 14 Nov 2014 18:18:05 +0000 (10:18 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 19 Nov 2014 18:35:12 +0000 (10:35 -0800)
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 <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #411

15 files changed:
include/linux/wait_compat.h
include/sys/types.h
module/spl/spl-generic.c
module/spl/spl-kmem.c
module/spl/spl-vnode.c
module/spl/spl-zlib.c
module/splat/splat-atomic.c
module/splat/splat-ctl.c
module/splat/splat-generic.c
module/splat/splat-linux.c
module/splat/splat-mutex.c
module/splat/splat-rwlock.c
module/splat/splat-taskq.c
module/splat/splat-thread.c
module/splat/splat-time.c

index 66f9a9a613050a5ffd74921789c814c8d25db26d..d8cd09b9eb08431f6a425fbd740c2e4baff8dc55 100644 (file)
@@ -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)
index b7b8b7bfc305b27d7137f9f5061f4d6e7ea66625..3b3a42edebc0ef2f1fd0708b204f97281154be3e 100644 (file)
 #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
index ecfb663de5e590fc5cb36d5df26a9945311d08c1..803f03a8593867f18b8ca88d7a928ed27018005a 100644 (file)
@@ -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;
index 37849f504e7a54fe9cc951126129c03f6111df95..502f5365b67ec848e8e4be1f280ebb52c0de7461 100644 (file)
@@ -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
index cac0aaf29271a2f4547afd1b9f5750e785f4de69..e5db0ec2ccb8016000fd0a0f35920c88d3c82ef1 100644 (file)
@@ -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);
index 2b8aab86564ee92ae182028726306f79e2213c85..2967b03ceaa182a67fe68e45a9415add669df39d 100644 (file)
@@ -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;
 
index 7a1bd859d85bcb39a5d2ac1ea441270059ae02ce..a270dc42f9b19d735297e366aca341f732a099a8 100644 (file)
@@ -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"
 
index 46bc6d1a684c5a0ffb5fccf9b3c97fa03416bb9f..bedf5d2d873f694068b0f951b63af430a8d85321 100644 (file)
  *  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;
index ad03651d00cdc5415916c9962dc3f0712cf7356f..3f8119b1ee0420320bd8108a05241f302c7e2715 100644 (file)
@@ -25,6 +25,7 @@
 \*****************************************************************************/
 
 #include <sys/sunddi.h>
+#include <linux/math64_compat.h>
 #include "splat-internal.h"
 
 #define SPLAT_GENERIC_NAME             "generic"
index 880b30152586355fd7bb0fe527fea9fc7e6a1ca5..3652267f940caafb432bd16b4fec2aee618941c6 100644 (file)
@@ -24,6 +24,7 @@
 \*****************************************************************************/
 
 #include <sys/kmem.h>
+#include <linux/mm_compat.h>
 #include "splat-internal.h"
 
 #define SPLAT_LINUX_NAME               "linux"
index cc1d36869668852e81940c3c69dedc89d11e8734..909d730cb014453e1bdca80d041ceabc6f3e5896 100644 (file)
@@ -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"
index 6faf7d24e227f4aa1532d56c19d924e779f98f35..6c623792e645eedb420be3416adcd7382825f388 100644 (file)
  *  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"
index 33e49b2f124516f5c1927a51c58b2298397d414f..6c2b435798b5c3bc0f3348cd7a5ecb87d86e5c3b 100644 (file)
  *  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"
index e55acd0c8c4c5bcce6742a8d95ac79b8acdc2160..3255e37e5b8d515ba2dd607dcbd0c8615baf8dcc 100644 (file)
@@ -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"
 
index cd513c93f91f1a966d1ec4f4e40c4a3f3dc077c0..b4e94c866244bf11e9079407ca9ee7f26c1a0f73 100644 (file)
@@ -25,6 +25,7 @@
 \*****************************************************************************/
 
 #include <sys/time.h>
+#include <linux/mm_compat.h>
 #include <linux/slab.h>
 #include "splat-internal.h"