]> granicus.if.org Git - spl/commitdiff
More 2.6.26 compat changes
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Mon, 11 Aug 2008 17:56:40 +0000 (17:56 +0000)
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Mon, 11 Aug 2008 17:56:40 +0000 (17:56 +0000)
git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@153 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

autoconf/spl-build.m4
configure.ac
include/linux/bitops_compat.h [moved from include/linux/bitops_compat.c with 100% similarity]
include/linux/file_compat.h [new file with mode: 0644]
modules/splat/splat-internal.h
modules/splat/splat-vnode.c

index ada13247b0c202dad60db07a4af70a8b4679de13..be0fa24790d03d596f896d1c11b49e180b6b1d73 100644 (file)
@@ -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 <linux/time.h>
        ],[
@@ -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 <linux/time.h>
        ],[
@@ -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], [], [])
+])
index f932081151321f715fcc7cf547346b4a5ab1530e..58d469e1b07d8cc3af8522cecee732d673d5edb2 100644 (file)
@@ -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/file_compat.h b/include/linux/file_compat.h
new file mode 100644 (file)
index 0000000..c63be03
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef _SPL_FILE_COMPAT_H
+#define _SPL_FILE_COMPAT_H
+
+#ifdef HAVE_FDTABLE_HEADER
+#include <linux/fdtable.h>
+#endif
+
+#endif /* SPL_FILE_COMPAT_H */
+
index 8a744768580c19ddd6d0767d61d9403b8caffbc0..a9c8e434f0e3661355b61797d948f78ac4c7a96c 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/list.h>
+
 #include <asm/ioctls.h>
 #include <asm/uaccess.h>
 #include <stdarg.h>
 #include <sys/atomic.h>
 #include <linux/cdev.h>
 
+#include <linux/file_compat.h>
+#include <linux/list_compat.h>
+#include <linux/time_compat.h>
+#include <linux/bitops_compat.h>
+
 #include "spl-device.h"
 #include "splat-ctl.h"
 
index 76840114302b9ddd4a876442b0cea79e1bd1caf4..6f97503880c08243c4a727bdeb3421913a5f9807 100644 (file)
@@ -26,7 +26,6 @@
 
 #include "splat-internal.h"
 #include <linux/rcupdate.h>
-#include <linux/fdtable.h>
 
 #define SPLAT_SUBSYSTEM_VNODE          0x0900
 #define SPLAT_VNODE_NAME               "vnode"