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 <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #411
This commit is contained in:
Ned Bass
2014-11-14 10:18:05 -08:00
committed by Brian Behlendorf
parent 8d9a23e82c
commit 52479ecf58
15 changed files with 29 additions and 23 deletions
+1
View 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"
+9 -8
View File
@@ -43,16 +43,17 @@
* of regression tests or particular tests.
\*****************************************************************************/
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/vmalloc.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 <sys/types.h>
#include <linux/cdev.h>
#include <linux/fs.h>
#include <linux/miscdevice.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;
+1
View File
@@ -25,6 +25,7 @@
\*****************************************************************************/
#include <sys/sunddi.h>
#include <linux/math64_compat.h>
#include "splat-internal.h"
#define SPLAT_GENERIC_NAME "generic"
+1
View File
@@ -24,6 +24,7 @@
\*****************************************************************************/
#include <sys/kmem.h>
#include <linux/mm_compat.h>
#include "splat-internal.h"
#define SPLAT_LINUX_NAME "linux"
+2
View 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"
+3 -1
View File
@@ -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"
+3 -2
View File
@@ -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"
+2
View 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"
+1
View File
@@ -25,6 +25,7 @@
\*****************************************************************************/
#include <sys/time.h>
#include <linux/mm_compat.h>
#include <linux/slab.h>
#include "splat-internal.h"