diff --git a/autoconf/spl-build.m4 b/autoconf/spl-build.m4 index ada13247b..be0fa2479 100644 --- a/autoconf/spl-build.m4 +++ b/autoconf/spl-build.m4 @@ -289,7 +289,25 @@ AC_DEFUN([SPL_CHECK_SYMBOL_EXPORT], fi ]) - +dnl # +dnl # SPL_CHECK_HEADER +dnl # check whether header exists and define HAVE_$2_HEADER +dnl # +AC_DEFUN([SPL_CHECK_HEADER], + [AC_MSG_CHECKING([whether header $1 exists]) + SPL_LINUX_TRY_COMPILE([ + #include <$1> + ],[ + return 0; + ],[ + AC_DEFINE(HAVE_$2_HEADER, 1, [$1 exists]) + AC_MSG_RESULT(yes) + $3 + ],[ + AC_MSG_RESULT(no) + $4 + ]) +]) dnl # dnl # 2.6.x API change @@ -516,8 +534,8 @@ dnl # dnl # 2.6.16 API change, set_normalize_timespec() moved to time.c dnl # previously it was available in time.h as an inline. dnl # -AC_DEFUN([SPL_AC_SET_NORMALIZED_TIMESPEC_INLINE], - [AC_MSG_CHECKING([whether set_normalized_timespec() is an inline]) +AC_DEFUN([SPL_AC_SET_NORMALIZED_TIMESPEC_INLINE], [ + AC_MSG_CHECKING([whether set_normalized_timespec() is an inline]) SPL_LINUX_TRY_COMPILE([ #include ],[ @@ -536,8 +554,8 @@ dnl # dnl # 2.6.18 API change, dnl # timespec_sub() inline function available in linux/time.h dnl # -AC_DEFUN([SPL_AC_TIMESPEC_SUB], - [AC_MSG_CHECKING([whether timespec_sub() is available]) +AC_DEFUN([SPL_AC_TIMESPEC_SUB], [ + AC_MSG_CHECKING([whether timespec_sub() is available]) SPL_LINUX_TRY_COMPILE([ #include ],[ @@ -551,3 +569,10 @@ AC_DEFUN([SPL_AC_TIMESPEC_SUB], ]) ]) +dnl # +dnl # 2.6,26 API change +dnl # Definition of struct fdtable relocated to linux/fdtable.h +dnl # +AC_DEFUN([SPL_AC_FDTABLE_HEADER], [ + SPL_CHECK_HEADER([linux/fdtable.h], [FDTABLE], [], []) +]) diff --git a/configure.ac b/configure.ac index f93208115..58d469e1b 100644 --- a/configure.ac +++ b/configure.ac @@ -57,6 +57,7 @@ SPL_AC_CLASS_DEVICE_CREATE SPL_AC_SET_NORMALIZED_TIMESPEC_EXPORT SPL_AC_SET_NORMALIZED_TIMESPEC_INLINE SPL_AC_TIMESPEC_SUB +SPL_AC_FDTABLE_HEADER TOPDIR=`/bin/pwd` diff --git a/include/linux/bitops_compat.c b/include/linux/bitops_compat.h similarity index 100% rename from include/linux/bitops_compat.c rename to include/linux/bitops_compat.h diff --git a/include/linux/file_compat.h b/include/linux/file_compat.h new file mode 100644 index 000000000..c63be0348 --- /dev/null +++ b/include/linux/file_compat.h @@ -0,0 +1,9 @@ +#ifndef _SPL_FILE_COMPAT_H +#define _SPL_FILE_COMPAT_H + +#ifdef HAVE_FDTABLE_HEADER +#include +#endif + +#endif /* SPL_FILE_COMPAT_H */ + diff --git a/modules/splat/splat-internal.h b/modules/splat/splat-internal.h index 8a7447685..a9c8e434f 100644 --- a/modules/splat/splat-internal.h +++ b/modules/splat/splat-internal.h @@ -40,6 +40,7 @@ #include #include #include + #include #include #include @@ -62,6 +63,11 @@ #include #include +#include +#include +#include +#include + #include "spl-device.h" #include "splat-ctl.h" diff --git a/modules/splat/splat-vnode.c b/modules/splat/splat-vnode.c index 768401143..6f9750388 100644 --- a/modules/splat/splat-vnode.c +++ b/modules/splat/splat-vnode.c @@ -26,7 +26,6 @@ #include "splat-internal.h" #include -#include #define SPLAT_SUBSYSTEM_VNODE 0x0900 #define SPLAT_VNODE_NAME "vnode"