linux-try-kbuild-20060804
authorChas Williams <chas@cmf.nrl.navy.mil>
Fri, 4 Aug 2006 16:42:55 +0000 (16:42 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 4 Aug 2006 16:42:55 +0000 (16:42 +0000)
FIXES 34561

the real reason i upgraded auto*

acinclude.m4
src/cf/linux-test1.m4
src/cf/linux-test2.m4
src/cf/linux-test3.m4
src/cf/linux-test4.m4

index 32f9dfc..386f8f2 100644 (file)
@@ -558,6 +558,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                   [LINUX_BUILD_VNODE_FROM_INODE(src/config,src/afs)],
                   [LINUX_BUILD_VNODE_FROM_INODE(${srcdir}/src/config,src/afs/LINUX,${srcdir}/src/afs/LINUX)]
                 )
+
                 LINUX_COMPLETION_H_EXISTS
                 LINUX_DEFINES_FOR_EACH_PROCESS
                 LINUX_DEFINES_PREV_TASK
@@ -576,7 +577,10 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_FS_STRUCT_INODE_HAS_INOTIFY_SEM
                 LINUX_INODE_SETATTR_RETURN_TYPE
                 LINUX_WRITE_INODE_RETURN_TYPE
-                LINUX_IOP_NAMEIDATA
+                LINUX_IOP_I_CREATE_TAKES_NAMEIDATA
+                LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA
+                LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA
+                LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA
                 LINUX_AOP_WRITEBACK_CONTROL
                 LINUX_KERNEL_LINUX_SYSCALL_H
                 LINUX_KERNEL_LINUX_SEQ_FILE_H
@@ -750,6 +754,24 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 if test "x$ac_cv_linux_sched_struct_task_struct_has_exit_state" = "xyes"; then 
                  AC_DEFINE(STRUCT_TASK_STRUCT_HAS_EXIT_STATE, 1, [define if your struct task_struct has exit_state])
                 fi
+                if test "x$ac_cv_linux_func_a_writepage_takes_writeback_control" = "xyes" ; then
+                 AC_DEFINE(AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL, 1, [define if your aops.writepage takes a struct writeback_control argument])
+                fi
+                if test "x$ac_cv_linux_func_refrigerator_takes_pf_freeze" = "xyes" ; then
+                 AC_DEFINE(LINUX_REFRIGERATOR_TAKES_PF_FREEZE, 1, [define if your refrigerator takes PF_FREEZE])
+                fi
+                if test "x$ac_cv_linux_func_i_create_takes_nameidata" = "xyes" ; then
+                 AC_DEFINE(IOP_CREATE_TAKES_NAMEIDATA, 1, [define if your iops.create takes a nameidata argument])
+                fi
+                if test "x$ac_cv_linux_func_i_lookup_takes_nameidata" = "xyes" ; then
+                 AC_DEFINE(IOP_LOOKUP_TAKES_NAMEIDATA, 1, [define if your iops.lookup takes a nameidata argument])
+                fi
+                if test "x$ac_cv_linux_func_i_permission_takes_nameidata" = "xyes" ; then
+                 AC_DEFINE(IOP_PERMISSION_TAKES_NAMEIDATA, 1, [define if your iops.permission takes a nameidata argument])
+                fi
+                if test "x$ac_cv_linux_func_d_revalidate_takes_nameidata" = "xyes" ; then
+                 AC_DEFINE(DOP_REVALIDATE_TAKES_NAMEIDATA, 1, [define if your dops.d_revalidate takes a nameidata argument])
+                fi
                 :
                fi
 esac
index f562bab..3934c90 100644 (file)
-AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYPE],[
-AC_MSG_CHECKING(for inode_setattr return type)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_func_inode_setattr_returns_int,
-[
-AC_TRY_COMPILE(
-[#include <linux/fs.h>],
-[struct inode _inode; 
-struct iattr _iattr;
-int i; 
-i = inode_setattr(&_inode, &_iattr);], 
-ac_cv_linux_func_inode_setattr_returns_int=yes,
-ac_cv_linux_func_inode_setattr_returns_int=no)])
-AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)
-CPPFLAGS="$save_CPPFLAGS"])
+# AC_TRY_KBUILD26([INCLUDES], [FUNCTION-BODY],
+#                 [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
+#
+AC_DEFUN([AC_TRY_KBUILD26], [
+  rm -fr conftest.dir
+  if mkdir conftest.dir; then
+  cd conftest.dir
+    cat >Makefile <<_ACEOF
+CFLAGS += $CPPFLAGS
 
-AC_DEFUN([LINUX_WRITE_INODE_RETURN_TYPE],[
-AC_MSG_CHECKING(for write_inode return type)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_func_write_inode_returns_int,
-[
-AC_TRY_COMPILE(
-[#include <linux/fs.h>],
-[struct inode _inode; 
-struct super_operations _sops;
-int i; 
-i = _sops.write_inode(&_inode, 0);], 
-ac_cv_linux_func_write_inode_returns_int=yes,
-ac_cv_linux_func_write_inode_returns_int=no)])
-AC_MSG_RESULT($ac_cv_linux_func_write_inode_returns_int)
-CPPFLAGS="$save_CPPFLAGS"])
+obj-m += conftest.o
+_ACEOF
+    cat >conftest.c <<\_ACEOF
+$1
 
-AC_DEFUN([LINUX_IOP_NAMEIDATA],[
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_MSG_CHECKING(whether inode_operations.create takes a nameidata)
-AC_CACHE_VAL(ac_cv_linux_func_i_create_takes_nameidata,
-[
-AC_TRY_COMPILE(
-[#include <linux/fs.h>
-#include <linux/namei.h>],
-[struct inode _inode; 
-struct dentry _dentry;
-struct nameidata _nameidata;
-(void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
-ac_cv_linux_func_i_create_takes_nameidata=yes,
-ac_cv_linux_func_i_create_takes_nameidata=no)])
-AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)
-if test "x$ac_cv_linux_func_i_create_takes_nameidata" = "xyes" ; then
-AC_DEFINE(IOP_CREATE_TAKES_NAMEIDATA, 1, [define if your iops.create takes a nameidata argument])
-fi
-AC_MSG_CHECKING(whether inode_operations.lookup takes a nameidata)
-AC_CACHE_VAL(ac_cv_linux_func_i_lookup_takes_nameidata,
-[
-AC_TRY_COMPILE(
-[#include <linux/fs.h>
-#include <linux/namei.h>],
-[struct inode _inode; 
-struct dentry _dentry;
-struct nameidata _nameidata;
-(void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
-ac_cv_linux_func_i_lookup_takes_nameidata=yes,
-ac_cv_linux_func_i_lookup_takes_nameidata=no)])
-AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)
-if test "x$ac_cv_linux_func_i_lookup_takes_nameidata" = "xyes" ; then
-AC_DEFINE(IOP_LOOKUP_TAKES_NAMEIDATA, 1, [define if your iops.lookup takes a nameidata argument])
-fi
-AC_MSG_CHECKING(whether inode_operations.permission takes a nameidata)
-AC_CACHE_VAL(ac_cv_linux_func_i_permission_takes_nameidata,
-[
-AC_TRY_COMPILE(
-[#include <linux/fs.h>
-#include <linux/namei.h>],
-[struct inode _inode; 
-struct nameidata _nameidata;
-(void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
-ac_cv_linux_func_i_permission_takes_nameidata=yes,
-ac_cv_linux_func_i_permission_takes_nameidata=no)])
-AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)
-if test "x$ac_cv_linux_func_i_permission_takes_nameidata" = "xyes" ; then
-AC_DEFINE(IOP_PERMISSION_TAKES_NAMEIDATA, 1, [define if your iops.permission takes a nameidata argument])
-fi
-AC_MSG_CHECKING(whether dentry_operations.d_revalidate takes a nameidata)
-CPPFLAGS="$CPPFLAGS -Werror"
-AC_CACHE_VAL(ac_cv_linux_func_d_revalidate_takes_nameidata,
-[
-AC_TRY_COMPILE(
-[#include <linux/fs.h>
-#include <linux/namei.h>],
-[struct dentry _dentry; 
-struct nameidata _nameidata;
-(void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
-ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
-ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
-AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)
-if test "x$ac_cv_linux_func_d_revalidate_takes_nameidata" = "xyes" ; then
-  AC_DEFINE(DOP_REVALIDATE_TAKES_NAMEIDATA, 1, [define if your dops.d_revalidate takes a nameidata argument])
-fi
-CPPFLAGS="$save_CPPFLAGS"])
+void conftest(void)
+{ 
+$2
+} 
+_ACEOF
+    cd ..
+  fi
+  AS_IF(AC_RUN_LOG([make -C $LINUX_KERNEL_PATH M=`pwd`/conftest.dir modules > /dev/null]),
+      [$3], [$4])
+  rm -fr conftest.dir])
 
-AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL],[
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_MSG_CHECKING(whether address_space_operations.writepage takes a writeback_control)
-AC_CACHE_VAL(ac_cv_linux_func_a_writepage_takes_writeback_control,
-[
-AC_TRY_COMPILE(
-[#include <linux/fs.h>
-#include <linux/mm.h>
-#include <linux/writeback.h>],
-[struct address_space_operations _aops; 
-struct page _page;
-struct writeback_control _writeback_control;
-(void)_aops.writepage(&_page, &_writeback_control);],
-ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
-ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
-AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)
-if test "x$ac_cv_linux_func_a_writepage_takes_writeback_control" = "xyes" ; then
-AC_DEFINE(AOP_WRITEPAGE_TAKES_WRITEBACK_CONTROL, 1, [define if your aops.writepage takes a struct writeback_control argument])
-fi
-CPPFLAGS="$save_CPPFLAGS"])
+  
+# AC_TRY_KBUILD24([INCLUDES], [FUNCTION-BODY],
+#                 [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
+#
+AC_DEFUN([AC_TRY_KBUILD24], [
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  CPPFLAGS="-I$LINUX_KERNEL_PATH/include -D__KERNEL__ $CPPFLAGS"
+  AC_TRY_COMPILE([$1], [$2], [$3], [$4])
+  CPPFLAGS="$ac_save_CPPFLAGS"])
 
-AC_DEFUN([LINUX_REFRIGERATOR],[
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_MSG_CHECKING(whether refrigerator takes PF_FREEZE)
-AC_CACHE_VAL(ac_cv_linux_func_refrigerator_takes_pf_freeze,
-[
-AC_TRY_COMPILE(
-[#include <linux/sched.h>],
-[
-refrigerator(PF_FREEZE);
-],
-ac_cv_linux_func_refrigerator_takes_pf_freeze=yes,
-ac_cv_linux_func_refrigerator_takes_pf_freeze=no)])
-AC_MSG_RESULT($ac_cv_linux_func_refrigerator_takes_pf_freeze)
-if test "x$ac_cv_linux_func_refrigerator_takes_pf_freeze" = "xyes" ; then
-AC_DEFINE(LINUX_REFRIGERATOR_TAKES_PF_FREEZE, 1, [define if your refrigerator takes PF_FREEZE])
-fi
-CPPFLAGS="$save_CPPFLAGS"])
+
+# AC_TRY_KBUILD([INCLUDES], [FUNCTION-BODY],
+#               [ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
+#
+AC_DEFUN([AC_TRY_KBUILD], [
+  if test -f $LINUX_KERNEL_PATH/scripts/Makefile.build; then
+    AC_TRY_KBUILD26([$1], [$2], [$3], [$4])
+  else
+    AC_TRY_KBUILD24([$1], [$2], [$3], [$4])
+  fi])
index 37d2d1a..150d61c 100644 (file)
@@ -1,79 +1,3 @@
-AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK], [
-AC_MSG_CHECKING(for gfp_mask in struct address_space)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_address_space_has_gfp_mask, 
-[
-AC_TRY_COMPILE(
-[#include <linux/fs.h>],
-[struct address_space _a;
-printf("%d\n", _a.gfp_mask);], 
-ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes,
-ac_cv_linux_fs_struct_address_space_has_gfp_mask=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_gfp_mask)
-CPPFLAGS="$save_CPPFLAGS"])
-
-AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BYTES], [
-AC_MSG_CHECKING(for i_bytes in struct inode)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_bytes, 
-[
-AC_TRY_COMPILE(
-[#include <linux/fs.h>],
-[struct inode _inode;
-printf("%d\n", _inode.i_bytes);], 
-ac_cv_linux_fs_struct_inode_has_i_bytes=yes,
-ac_cv_linux_fs_struct_inode_has_i_bytes=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes)
-CPPFLAGS="$save_CPPFLAGS"])
-
-AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM], [
-AC_MSG_CHECKING(for i_alloc_sem in struct inode)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_alloc_sem,
-[
-AC_TRY_COMPILE(
-[#include <linux/fs.h>],
-[struct inode _i;
-printf("%x\n", _i.i_alloc_sem);], 
-ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes,
-ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_alloc_sem)
-CPPFLAGS="$save_CPPFLAGS"])
-
-AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM], [
-AC_MSG_CHECKING(for i_truncate_sem in struct inode)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_truncate_sem,
-[
-AC_TRY_COMPILE(
-[#include <linux/fs.h>],
-[struct inode _i;
-printf("%x\n", _i.i_truncate_sem);], 
-ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes,
-ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem)
-CPPFLAGS="$save_CPPFLAGS"])
-
-AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK], [
-AC_MSG_CHECKING(for page_lock in struct address_space)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_address_space_has_page_lock, 
-[
-AC_TRY_COMPILE(
-[#include <linux/fs.h>],
-[struct address_space _a_s;
-printf("%x\n", _a_s.page_lock);], 
-ac_cv_linux_fs_struct_address_space_has_page_lock=yes,
-ac_cv_linux_fs_struct_address_space_has_page_lock=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_page_lock)
-CPPFLAGS="$save_CPPFLAGS"])
-
-
 dnl LINUX_BUILD_VNODE_FROM_INODE (configdir, outputdir, tmpldir)
 dnl            defaults: (src/config, src/afs/LINUX, src/afs/linux)
 
index 76d90e8..2c9ea99 100644 (file)
@@ -82,38 +82,6 @@ AC_TRY_COMPILE(
 AC_MSG_RESULT($ac_cv_linux_kernel_is_selinux)
 CPPFLAGS="$save_CPPFLAGS"])
 
-AC_DEFUN([LINUX_KERNEL_SOCK_CREATE],[
-AC_MSG_CHECKING(for 5th argument in sock_create found in some SELinux kernels)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ -DKBUILD_BASENAME=\\"libafs\\" $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_kernel_sock_create_v,
-[
-AC_TRY_COMPILE(
-  [#include <linux/net.h>],
-  [
-  sock_create(0,0,0,0,0)
-  ],
-  ac_cv_linux_kernel_sock_create_v=yes,
-  ac_cv_linux_kernel_sock_create_v=no)])
-AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)
-CPPFLAGS="$save_CPPFLAGS"])
-
-AC_DEFUN([LINUX_KERNEL_PAGE_FOLLOW_LINK],[
-AC_MSG_CHECKING(for page_follow_link_light vs page_follow_link)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-default -Werror-implicit-function-declaration -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_kernel_page_follow_link,
-[
-AC_TRY_COMPILE(
-  [#include <linux/fs.h>],
-  [
-  page_follow_link(0,0)
-  ],
-  ac_cv_linux_kernel_page_follow_link=yes,
-  ac_cv_linux_kernel_page_follow_link=no)])
-AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_link)
-CPPFLAGS="$save_CPPFLAGS"])
-
 AC_DEFUN([LINUX_KERNEL_LINUX_SEQ_FILE_H],[
   AC_MSG_CHECKING(for linux/seq_file.h in kernel)
   if test -f "${LINUX_KERNEL_PATH}/include/linux/seq_file.h"; then
index e094538..48c139e 100644 (file)
 AC_DEFUN([LINUX_COMPLETION_H_EXISTS], [
-AC_MSG_CHECKING(for linux/completion.h existance)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_completion_h_exists,
-[
-AC_TRY_COMPILE(
-[#include <linux/completion.h>
-#include <linux/version.h>],
+  AC_MSG_CHECKING([for linux/completion.h existance])
+  AC_CACHE_VAL([ac_cv_linux_completion_h_exists], [
+    AC_TRY_KBUILD(
+[#include <linux/version.h>
+#include <linux/completion.h>],
 [struct completion _c;
 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8)
 lose
-#endif
-],
-ac_cv_linux_completion_h_exists=yes,
-ac_cv_linux_completion_h_exists=no)])
-AC_MSG_RESULT($ac_cv_linux_completion_h_exists)
-CPPFLAGS="$save_CPPFLAGS"])
+#endif],
+      ac_cv_linux_completion_h_exists=yes,
+      ac_cv_linux_completion_h_exists=no)])
+  AC_MSG_RESULT($ac_cv_linux_completion_h_exists)])
 
 
 AC_DEFUN([LINUX_DEFINES_FOR_EACH_PROCESS], [
-AC_MSG_CHECKING(for defined for_each_process)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_defines_for_each_process,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for defined for_each_process])
+  AC_CACHE_VAL([ac_cv_linux_defines_for_each_process], [
+    AC_TRY_KBUILD(
 [#include <linux/sched.h>],
-[#ifndef for_each_process(p)
+[#ifndef for_each_process
 #error for_each_process not defined
 #endif],
-ac_cv_linux_defines_for_each_process=yes,
-ac_cv_linux_defines_for_each_process=no)])
-AC_MSG_RESULT($ac_cv_linux_defines_for_each_process)
-CPPFLAGS="$save_CPPFLAGS"])
+      ac_cv_linux_defines_for_each_process=yes,
+      ac_cv_linux_defines_for_each_process=no)])
+  AC_MSG_RESULT($ac_cv_linux_defines_for_each_process)])
 
 
 AC_DEFUN([LINUX_DEFINES_PREV_TASK], [
-AC_MSG_CHECKING(for defined prev_task)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_defines_prev_task,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for defined prev_task])
+  AC_CACHE_VAL([ac_cv_linux_defines_prev_task], [
+    AC_TRY_KBUILD(
 [#include <linux/sched.h>],
-[#ifndef prev_task(p)
+[#ifndef prev_task
 #error prev_task not defined
 #endif],
-ac_cv_linux_defines_prev_task=yes,
-ac_cv_linux_defines_prev_task=no)])
-AC_MSG_RESULT($ac_cv_linux_defines_prev_task)
-CPPFLAGS="$save_CPPFLAGS"])
+      ac_cv_linux_defines_prev_task=yes,
+      ac_cv_linux_defines_prev_task=no)])
+  AC_MSG_RESULT($ac_cv_linux_defines_prev_task)])
 
 
 AC_DEFUN([LINUX_EXPORTS_INIT_MM], [
-AC_MSG_CHECKING(for exported init_mm)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_exports_init_mm,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for exported init_mm])
+  AC_CACHE_VAL([ac_cv_linux_exports_init_mm], [
+    AC_TRY_KBUILD(
 [#include <linux/modversions.h>],
 [#ifndef __ver_init_mm
 #error init_mm not exported
 #endif],
-ac_cv_linux_exports_init_mm=yes,
-ac_cv_linux_exports_init_mm=no)])
-AC_MSG_RESULT($ac_cv_linux_exports_init_mm)
-CPPFLAGS="$save_CPPFLAGS"])
+      ac_cv_linux_exports_init_mm=yes,
+      ac_cv_linux_exports_init_mm=no)])
+  AC_MSG_RESULT($ac_cv_linux_exports_init_mm)])
 
 
 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_ADDRESS], [
-AC_MSG_CHECKING(for exported kallsyms_address_to_symbol)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_exports_kallsyms_address,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for exported kallsyms_address_to_symbol])
+  AC_CACHE_VAL([ac_cv_linux_exports_kallsyms_address], [
+    AC_TRY_KBUILD(
 [#include <linux/modversions.h>],
 [#ifndef __ver_kallsyms_address_to_symbol
 #error kallsyms_address_to_symbol not exported
 #endif],
-ac_cv_linux_exports_kallsyms_address=yes,
-ac_cv_linux_exports_kallsyms_address=no)])
-AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_address)
-CPPFLAGS="$save_CPPFLAGS"])
+      ac_cv_linux_exports_kallsyms_address=yes,
+      ac_cv_linux_exports_kallsyms_address=no)])
+  AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_address)])
 
 
 AC_DEFUN([LINUX_EXPORTS_KALLSYMS_SYMBOL], [
-AC_MSG_CHECKING(for exported kallsyms_symbol_to_address)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_exports_kallsyms_symbol,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for exported kallsyms_symbol_to_address])
+  AC_CACHE_VAL([ac_cv_linux_exports_kallsyms_symbol], [
+    AC_TRY_KBUILD(
 [#include <linux/modversions.h>],
 [#ifndef __ver_kallsyms_symbol_to_address
 #error kallsyms_symbol_to_address not exported
 #endif],
-ac_cv_linux_exports_kallsyms_symbol=yes,
-ac_cv_linux_exports_kallsyms_symbol=no)])
-AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_symbol)
-CPPFLAGS="$save_CPPFLAGS"])
-
+      ac_cv_linux_exports_kallsyms_symbol=yes,
+      ac_cv_linux_exports_kallsyms_symbol=no)])
+  AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_symbol)])
 
 AC_DEFUN([LINUX_EXPORTS_SYS_CALL_TABLE], [
-AC_MSG_CHECKING(for exported sys_call_table)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_exports_sys_call_table,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for exported sys_call_table])
+  AC_CACHE_VAL([ac_cv_linux_exports_sys_call_table], [
+    AC_TRY_KBUILD(
 [#include <linux/modversions.h>],
 [#ifndef __ver_sys_call_table
 #error sys_call_table not exported
 #endif],
-ac_cv_linux_exports_sys_call_table=yes,
-ac_cv_linux_exports_sys_call_table=no)])
-AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table)
-CPPFLAGS="$save_CPPFLAGS"])
+      ac_cv_linux_exports_sys_call_table=yes,
+      ac_cv_linux_exports_sys_call_table=no)])
+  AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table)])
 
 
 AC_DEFUN([LINUX_EXPORTS_IA32_SYS_CALL_TABLE], [
-AC_MSG_CHECKING(for exported ia32_sys_call_table)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_exports_ia32_sys_call_table,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for exported ia32_sys_call_table])
+  AC_CACHE_VAL([ac_cv_linux_exports_ia32_sys_call_table], [
+    AC_TRY_KBUILD(
 [#include <linux/modversions.h>],
 [#ifndef __ver_ia32_sys_call_table
 #error ia32_sys_call_table not exported
 #endif],
-ac_cv_linux_exports_ia32_sys_call_table=yes,
-ac_cv_linux_exports_ia32_sys_call_table=no)])
-AC_MSG_RESULT($ac_cv_linux_exports_ia32_sys_call_table)
-CPPFLAGS="$save_CPPFLAGS"])
+      ac_cv_linux_exports_ia32_sys_call_table=yes,
+      ac_cv_linux_exports_ia32_sys_call_table=no)])
+  AC_MSG_RESULT($ac_cv_linux_exports_ia32_sys_call_table)])
 
 
 AC_DEFUN([LINUX_EXPORTS_SYS_CHDIR], [
-AC_MSG_CHECKING(for exported sys_chdir)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_exports_sys_chdir,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for exported sys_chdir])
+  AC_CACHE_VAL([ac_cv_linux_exports_sys_chdir], [
+    AC_TRY_KBUILD(
 [#include <linux/modversions.h>],
 [#ifndef __ver_sys_chdir
 #error sys_chdir not exported
 #endif],
-ac_cv_linux_exports_sys_chdir=yes,
-ac_cv_linux_exports_sys_chdir=no)])
-AC_MSG_RESULT($ac_cv_linux_exports_sys_chdir)
-CPPFLAGS="$save_CPPFLAGS"])
+      ac_cv_linux_exports_sys_chdir=yes,
+      ac_cv_linux_exports_sys_chdir=no)])
+  AC_MSG_RESULT($ac_cv_linux_exports_sys_chdir)])
 
 
 AC_DEFUN([LINUX_EXPORTS_SYS_CLOSE], [
-AC_MSG_CHECKING(for exported sys_close)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_exports_sys_close,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for exported sys_close])
+  AC_CACHE_VAL([ac_cv_linux_exports_sys_close], [
+    AC_TRY_KBUILD(
 [#include <linux/modversions.h>],
 [#ifndef __ver_sys_close
 #error sys_close not exported
 #endif],
-ac_cv_linux_exports_sys_close=yes,
-ac_cv_linux_exports_sys_close=no)])
-AC_MSG_RESULT($ac_cv_linux_exports_sys_close)
-CPPFLAGS="$save_CPPFLAGS"])
+      ac_cv_linux_exports_sys_close=yes,
+      ac_cv_linux_exports_sys_close=no)])
+  AC_MSG_RESULT($ac_cv_linux_exports_sys_close)])
 
 
 AC_DEFUN([LINUX_EXPORTS_SYS_WAIT4], [
-AC_MSG_CHECKING(for exported sys_wait4)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_exports_sys_wait4,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for exported sys_wait4])
+  AC_CACHE_VAL([ac_cv_linux_exports_sys_wait4], [
+    AC_TRY_KBUILD(
 [#include <linux/modversions.h>],
 [#ifndef __ver_sys_wait4
 #error sys_wait4 not exported
 #endif],
-ac_cv_linux_exports_sys_wait4=yes,
-ac_cv_linux_exports_sys_wait4=no)])
-AC_MSG_RESULT($ac_cv_linux_exports_sys_wait4)
-CPPFLAGS="$save_CPPFLAGS"])
+      ac_cv_linux_exports_sys_wait4=yes,
+      ac_cv_linux_exports_sys_wait4=no)])
+  AC_MSG_RESULT($ac_cv_linux_exports_sys_wait4)])
 
 
 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_CDEV], [
-AC_MSG_CHECKING(for i_cdev in struct inode)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, 
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for i_cdev in struct inode])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_cdev], [
+    AC_TRY_KBUILD(
 [#include <linux/fs.h>],
 [struct inode _inode;
-printf("%d\n", _inode.i_cdev);], 
-ac_cv_linux_fs_struct_inode_has_i_cdev=yes,
-ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _inode.i_cdev);],
+      ac_cv_linux_fs_struct_inode_has_i_cdev=yes,
+      ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)])
 
 
 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_DEVICES], [
-AC_MSG_CHECKING(for i_devices in struct inode)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_devices, 
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for i_devices in struct inode])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_devices], [
+    AC_TRY_KBUILD(
 [#include <linux/fs.h>],
 [struct inode _inode;
-printf("%d\n", _inode.i_devices);], 
-ac_cv_linux_fs_struct_inode_has_i_devices=yes,
-ac_cv_linux_fs_struct_inode_has_i_devices=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _inode.i_devices);],
+      ac_cv_linux_fs_struct_inode_has_i_devices=yes,
+      ac_cv_linux_fs_struct_inode_has_i_devices=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices)])
 
 
 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS], [
-AC_MSG_CHECKING(for i_dirty_data_buffers in struct inode)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers, 
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for i_dirty_data_buffers in struct inode])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers], [
+    AC_TRY_KBUILD(
 [#include <linux/fs.h>],
 [struct inode _inode;
-printf("%d\n", _inode.i_dirty_data_buffers);], 
-ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes,
-ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _inode.i_dirty_data_buffers);],
+      ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=yes,
+      ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers)])
 
 
 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_INOTIFY_LOCK], [
-AC_MSG_CHECKING(for inotify_lock in struct inode)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_inotify_lock, 
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for inotify_lock in struct inode])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_inotify_lock], [
+    AC_TRY_KBUILD(
 [#include <linux/fs.h>],
 [struct inode _inode;
-printf("%d\n", _inode.inotify_lock);], 
-ac_cv_linux_fs_struct_inode_has_inotify_lock=yes,
-ac_cv_linux_fs_struct_inode_has_inotify_lock=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_lock)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _inode.inotify_lock);],
+      ac_cv_linux_fs_struct_inode_has_inotify_lock=yes,
+      ac_cv_linux_fs_struct_inode_has_inotify_lock=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_lock)])
 
 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_INOTIFY_SEM], [
-AC_MSG_CHECKING(for inotify_sem in struct inode)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_inotify_sem, 
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for inotify_sem in struct inode])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_inotify_sem], [
+    AC_TRY_KBUILD(
 [#include <linux/fs.h>],
 [struct inode _inode;
-printf("%x\n", _inode.inotify_sem);], 
-ac_cv_linux_fs_struct_inode_has_inotify_sem=yes,
-ac_cv_linux_fs_struct_inode_has_inotify_sem=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_sem)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%x\n", _inode.inotify_sem);],
+      ac_cv_linux_fs_struct_inode_has_inotify_sem=yes,
+      ac_cv_linux_fs_struct_inode_has_inotify_sem=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_inotify_sem)])
 
 
 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD], [
-AC_MSG_CHECKING(for i_mapping_overload in struct inode)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mapping_overload, 
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for i_mapping_overload in struct inode])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mapping_overload], [
+    AC_TRY_KBUILD(
 [#include <linux/fs.h>],
 [struct inode _inode;
-printf("%d\n", _inode.i_mapping_overload);], 
-ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes,
-ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _inode.i_mapping_overload);],
+      ac_cv_linux_fs_struct_inode_has_i_mapping_overload=yes,
+      ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload)])
 
 
 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED], [
-AC_MSG_CHECKING(for i_mmap_shared in struct inode)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mmap_shared,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for i_mmap_shared in struct inode])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mmap_shared], [
+    AC_TRY_KBUILD(
 [#include <linux/fs.h>],
 [struct inode _inode;
-printf("%d\n", _inode.i_mmap_shared);],
-ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes,
-ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _inode.i_mmap_shared);],
+      ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes,
+      ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)])
 
 
 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_MUTEX], [
-AC_MSG_CHECKING(for i_mutex in struct inode)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mutex, 
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for i_mutex in struct inode])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_mutex], [
+    AC_TRY_KBUILD(
 [#include <linux/fs.h>],
 [struct inode _inode;
-printf("%d\n", _inode.i_mutex);], 
-ac_cv_linux_fs_struct_inode_has_i_mutex=yes,
-ac_cv_linux_fs_struct_inode_has_i_mutex=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mutex)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _inode.i_mutex);],
+      ac_cv_linux_fs_struct_inode_has_i_mutex=yes,
+      ac_cv_linux_fs_struct_inode_has_i_mutex=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mutex)])
 
 
 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SECURITY], [
-AC_MSG_CHECKING(for i_security in struct inode)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_security, 
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for i_security in struct inode])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_security], [
+    AC_TRY_KBUILD(
 [#include <linux/fs.h>],
 [struct inode _inode;
-printf("%d\n", _inode.i_security);], 
-ac_cv_linux_fs_struct_inode_has_i_security=yes,
-ac_cv_linux_fs_struct_inode_has_i_security=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_security)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _inode.i_security);],
+      ac_cv_linux_fs_struct_inode_has_i_security=yes,
+      ac_cv_linux_fs_struct_inode_has_i_security=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_security)])
 
 
 AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_SB_LIST], [
-AC_MSG_CHECKING(for i_sb_list in struct inode)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_sb_list, 
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for i_sb_list in struct inode])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_sb_list], [
+    AC_TRY_KBUILD(
 [#include <linux/fs.h>],
 [struct inode _inode;
-printf("%d\n", _inode.i_sb_list);], 
-ac_cv_linux_fs_struct_inode_has_i_sb_list=yes,
-ac_cv_linux_fs_struct_inode_has_i_sb_list=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_sb_list)
-CPPFLAGS="$save_CPPFLAGS"])
-
-
-AC_DEFUN([LINUX_RECALC_SIGPENDING_ARG_TYPE],[
-AC_MSG_CHECKING(for recalc_sigpending arg type)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_func_recalc_sigpending_takes_void,
-[
-AC_TRY_COMPILE(
+printk("%d\n", _inode.i_sb_list);],
+      ac_cv_linux_fs_struct_inode_has_i_sb_list=yes,
+      ac_cv_linux_fs_struct_inode_has_i_sb_list=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_sb_list)])
+
+
+AC_DEFUN([LINUX_RECALC_SIGPENDING_ARG_TYPE], [
+  AC_MSG_CHECKING([for recalc_sigpending arg type])
+  AC_CACHE_VAL([ac_cv_linux_func_recalc_sigpending_takes_void], [
+    AC_TRY_KBUILD(
 [#include <linux/sched.h>],
 [recalc_sigpending();],
-ac_cv_linux_func_recalc_sigpending_takes_void=yes,
-ac_cv_linux_func_recalc_sigpending_takes_void=no)])
-AC_MSG_RESULT($ac_cv_linux_func_recalc_sigpending_takes_void)
-CPPFLAGS="$save_CPPFLAGS"])
+      ac_cv_linux_func_recalc_sigpending_takes_void=yes,
+      ac_cv_linux_func_recalc_sigpending_takes_void=no)])
+  AC_MSG_RESULT($ac_cv_linux_func_recalc_sigpending_takes_void)])
 
 
 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT], [
-AC_MSG_CHECKING(for parent in struct task_struct)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_parent,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for parent in struct task_struct])
+  AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_parent], [
+    AC_TRY_KBUILD(
 [#include <linux/sched.h>],
 [struct task_struct _tsk;
-printf("%d\n", _tsk.parent);],
-ac_cv_linux_sched_struct_task_struct_has_parent=yes,
-ac_cv_linux_sched_struct_task_struct_has_parent=no)])
-AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_parent)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _tsk.parent);],
+      ac_cv_linux_sched_struct_task_struct_has_parent=yes,
+      ac_cv_linux_sched_struct_task_struct_has_parent=no)])
+  AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_parent)])
 
 
 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT], [
-AC_MSG_CHECKING(for real_parent in struct task_struct)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_real_parent,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for real_parent in struct task_struct])
+  AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_real_parent], [
+    AC_TRY_KBUILD(
 [#include <linux/sched.h>],
 [struct task_struct _tsk;
-printf("%d\n", _tsk.real_parent);],
-ac_cv_linux_sched_struct_task_struct_has_real_parent=yes,
-ac_cv_linux_sched_struct_task_struct_has_real_parent=no)])
-AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_real_parent)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _tsk.real_parent);],
+      ac_cv_linux_sched_struct_task_struct_has_real_parent=yes,
+      ac_cv_linux_sched_struct_task_struct_has_real_parent=no)])
+  AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_real_parent)])
 
 
 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIG], [
-AC_MSG_CHECKING(for sig in struct task_struct)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_sig,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for sig in struct task_struct])
+  AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sig], [
+    AC_TRY_KBUILD(
 [#include <linux/sched.h>],
 [struct task_struct _tsk;
-printf("%d\n", _tsk.sig);],
-ac_cv_linux_sched_struct_task_struct_has_sig=yes,
-ac_cv_linux_sched_struct_task_struct_has_sig=no)])
-AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sig)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _tsk.sig);],
+      ac_cv_linux_sched_struct_task_struct_has_sig=yes,
+      ac_cv_linux_sched_struct_task_struct_has_sig=no)])
+  AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sig)])
+
 
 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK], [
-AC_MSG_CHECKING(for sigmask_lock in struct task_struct)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_sigmask_lock,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for sigmask_lock in struct task_struct])
+  AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sigmask_lock], [
+    AC_TRY_KBUILD(
 [#include <linux/sched.h>],
 [struct task_struct _tsk;
-printf("%d\n", _tsk.sigmask_lock);],
-ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes,
-ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no)])
-AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sigmask_lock)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _tsk.sigmask_lock);],
+      ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes,
+      ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no)])
+  AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sigmask_lock)])
+
 
 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGHAND], [
-AC_MSG_CHECKING(for sighand in struct task_struct)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_sighand,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for sighand in struct task_struct])
+  AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_sighand], [
+    AC_TRY_KBUILD(
 [#include <linux/sched.h>],
 [struct task_struct _tsk;
-printf("%d\n", _tsk.sighand);],
-ac_cv_linux_sched_struct_task_struct_has_sighand=yes,
-ac_cv_linux_sched_struct_task_struct_has_sighand=no)])
-AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sighand)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _tsk.sighand);],
+      ac_cv_linux_sched_struct_task_struct_has_sighand=yes,
+      ac_cv_linux_sched_struct_task_struct_has_sighand=no)])
+  AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sighand)])
+
 
 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_RLIM], [
-AC_MSG_CHECKING(for rlim in struct task_struct)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_rlim,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for rlim in struct task_struct])
+  AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_rlim], [
+    AC_TRY_KBUILD(
 [#include <linux/sched.h>],
 [struct task_struct _tsk;
-printf("%d\n", _tsk.rlim);],
-ac_cv_linux_sched_struct_task_struct_has_rlim=yes,
-ac_cv_linux_sched_struct_task_struct_has_rlim=no)])
-AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_rlim)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _tsk.rlim);],
+      ac_cv_linux_sched_struct_task_struct_has_rlim=yes,
+      ac_cv_linux_sched_struct_task_struct_has_rlim=no)])
+  AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_rlim)])
+
 
 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM], [
-AC_MSG_CHECKING(for signal->rlim in struct task_struct)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_signal_rlim,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for signal->rlim in struct task_struct])
+  AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_signal_rlim], [
+    AC_TRY_KBUILD(
 [#include <linux/sched.h>],
 [struct task_struct _tsk;
-printf("%d\n", _tsk.signal->rlim);],
-ac_cv_linux_sched_struct_task_struct_has_signal_rlim=yes,
-ac_cv_linux_sched_struct_task_struct_has_signal_rlim=no)])
-AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_signal_rlim)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _tsk.signal->rlim);],
+      ac_cv_linux_sched_struct_task_struct_has_signal_rlim=yes,
+      ac_cv_linux_sched_struct_task_struct_has_signal_rlim=no)])
+  AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_signal_rlim)])
+
 
 AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE], [
-AC_MSG_CHECKING(for exit_state in struct task_struct)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_exit_state,
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for exit_state in struct task_struct])
+  AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_exit_state], [
+    AC_TRY_KBUILD(
 [#include <linux/sched.h>],
 [struct task_struct _tsk;
-printf("%d\n", _tsk.exit_state);],
-ac_cv_linux_sched_struct_task_struct_has_exit_state=yes,
-ac_cv_linux_sched_struct_task_struct_has_exit_state=no)])
-AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_exit_state)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%d\n", _tsk.exit_state);],
+      ac_cv_linux_sched_struct_task_struct_has_exit_state=yes,
+      ac_cv_linux_sched_struct_task_struct_has_exit_state=no)])
+  AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_exit_state)])
+
 
 AC_DEFUN([LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE], [
-AC_MSG_CHECKING(for alloc_inode in struct super_operations)
-save_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -DKBUILD_BASENAME=\"libafs\" -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_super_has_alloc_inode, 
-[
-AC_TRY_COMPILE(
+  AC_MSG_CHECKING([for alloc_inode in struct super_operations])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_super_has_alloc_inode], [
+    AC_TRY_KBUILD(
 [#include <linux/fs.h>],
 [struct super_operations _super;
-printf("%p\n", _super.alloc_inode);], 
-ac_cv_linux_fs_struct_super_has_alloc_inode=yes,
-ac_cv_linux_fs_struct_super_has_alloc_inode=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_super_has_alloc_inode)
-CPPFLAGS="$save_CPPFLAGS"])
+printk("%p\n", _super.alloc_inode);],
+      ac_cv_linux_fs_struct_super_has_alloc_inode=yes,
+      ac_cv_linux_fs_struct_super_has_alloc_inode=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_super_has_alloc_inode)])
+
+
+AC_DEFUN([LINUX_KERNEL_SOCK_CREATE], [
+  AC_MSG_CHECKING([for 5th argument in sock_create found in some SELinux kernels])
+  AC_CACHE_VAL([ac_cv_linux_kernel_sock_create_v], [
+    AC_TRY_KBUILD(
+[#include <linux/net.h>],
+[sock_create(0,0,0,0,0);],
+      ac_cv_linux_kernel_sock_create_v=yes,
+      ac_cv_linux_kernel_sock_create_v=no)])
+  AC_MSG_RESULT($ac_cv_linux_kernel_sock_create_v)])
+
+
+AC_DEFUN([LINUX_KERNEL_PAGE_FOLLOW_LINK], [
+  AC_MSG_CHECKING([for page_follow_link_light vs page_follow_link])
+  AC_CACHE_VAL([ac_cv_linux_kernel_page_follow_link], [
+    save_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>],
+[page_follow_link(0,0);],
+      ac_cv_linux_kernel_page_follow_link=yes,
+      ac_cv_linux_kernel_page_follow_link=no)
+    CPPFLAGS="$save_CPPFLAGS"])
+  AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_link)])
+
+
+AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK], [
+  AC_MSG_CHECKING([for gfp_mask in struct address_space])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_address_space_has_gfp_mask], [
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>],
+[struct address_space _a;
+printk("%d\n", _a.gfp_mask);],
+      ac_cv_linux_fs_struct_address_space_has_gfp_mask=yes,
+      ac_cv_linux_fs_struct_address_space_has_gfp_mask=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_gfp_mask)])
+
+
+AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_BYTES], [
+  AC_MSG_CHECKING([for i_bytes in struct inode])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_bytes], [
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>],
+[struct inode _inode;
+printk("%d\n", _inode.i_bytes);],
+      ac_cv_linux_fs_struct_inode_has_i_bytes=yes,
+      ac_cv_linux_fs_struct_inode_has_i_bytes=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_bytes)])
+
+
+AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM], [
+  AC_MSG_CHECKING([for i_alloc_sem in struct inode])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_alloc_sem], [
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>],
+[struct inode _i;
+printk("%x\n", _i.i_alloc_sem);],
+      ac_cv_linux_fs_struct_inode_has_i_alloc_sem=yes,
+      ac_cv_linux_fs_struct_inode_has_i_alloc_sem=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_alloc_sem)])
+
+
+AC_DEFUN([LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM], [
+  AC_MSG_CHECKING([for i_truncate_sem in struct inode])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_inode_has_i_truncate_sem], [
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>],
+[struct inode _i;
+printk("%x\n", _i.i_truncate_sem);],
+      ac_cv_linux_fs_struct_inode_has_i_truncate_sem=yes,
+      ac_cv_linux_fs_struct_inode_has_i_truncate_sem=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_truncate_sem)])
+
+
+AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK], [
+  AC_MSG_CHECKING([for page_lock in struct address_space])
+  AC_CACHE_VAL([ac_cv_linux_fs_struct_address_space_has_page_lock], [
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>],
+[struct address_space _a_s;
+printk("%x\n", _a_s.page_lock);],
+      ac_cv_linux_fs_struct_address_space_has_page_lock=yes,
+      ac_cv_linux_fs_struct_address_space_has_page_lock=no)])
+  AC_MSG_RESULT($ac_cv_linux_fs_struct_address_space_has_page_lock)])
+
+
+AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYPE], [
+  AC_MSG_CHECKING([for inode_setattr return type])
+  AC_CACHE_VAL([ac_cv_linux_func_inode_setattr_returns_int], [
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>],
+[struct inode _inode;
+struct iattr _iattr;
+int i;
+i = inode_setattr(&_inode, &_iattr);],
+      ac_cv_linux_func_inode_setattr_returns_int=yes,
+      ac_cv_linux_func_inode_setattr_returns_int=no)])
+  AC_MSG_RESULT($ac_cv_linux_func_inode_setattr_returns_int)])
+
+
+AC_DEFUN([LINUX_WRITE_INODE_RETURN_TYPE], [
+  AC_MSG_CHECKING([for write_inode return type])
+  AC_CACHE_VAL([ac_cv_linux_func_write_inode_returns_int], [
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>],
+[struct inode _inode;
+struct super_operations _sops;
+int i;
+i = _sops.write_inode(&_inode, 0);],
+      ac_cv_linux_func_write_inode_returns_int=yes,
+      ac_cv_linux_func_write_inode_returns_int=no)])
+  AC_MSG_RESULT($ac_cv_linux_func_write_inode_returns_int)])
+
+
+AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL], [
+  AC_MSG_CHECKING([whether address_space_operations.writepage takes a writeback_control])
+  AC_CACHE_VAL([ac_cv_linux_func_a_writepage_takes_writeback_control], [
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>
+#include <linux/mm.h>
+#include <linux/writeback.h>],
+[struct address_space_operations _aops;
+struct page _page;
+struct writeback_control _writeback_control;
+(void)_aops.writepage(&_page, &_writeback_control);],
+      ac_cv_linux_func_a_writepage_takes_writeback_control=yes,
+      ac_cv_linux_func_a_writepage_takes_writeback_control=no)])
+  AC_MSG_RESULT($ac_cv_linux_func_a_writepage_takes_writeback_control)])
+
+
+AC_DEFUN([LINUX_REFRIGERATOR], [
+  AC_MSG_CHECKING([whether refrigerator takes PF_FREEZE])
+  AC_CACHE_VAL([ac_cv_linux_func_refrigerator_takes_pf_freeze], [
+    AC_TRY_KBUILD(
+[#include <linux/sched.h>],
+[refrigerator(PF_FREEZE);],
+      ac_cv_linux_func_refrigerator_takes_pf_freeze=yes,
+      ac_cv_linux_func_refrigerator_takes_pf_freeze=no)])
+  AC_MSG_RESULT($ac_cv_linux_func_refrigerator_takes_pf_freeze)])
+
+
+AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_NAMEIDATA], [
+  AC_MSG_CHECKING([whether inode_operations.create takes a nameidata])
+  AC_CACHE_VAL([ac_cv_linux_func_i_create_takes_nameidata], [
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct inode _inode;
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_inode.i_op->create(&_inode, &_dentry, 0, &_nameidata);],
+      ac_cv_linux_func_i_create_takes_nameidata=yes,
+      ac_cv_linux_func_i_create_takes_nameidata=no)])
+  AC_MSG_RESULT($ac_cv_linux_func_i_create_takes_nameidata)])
+
+
+AC_DEFUN([LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA], [
+  AC_MSG_CHECKING([whether inode_operations.lookup takes a nameidata])
+  AC_CACHE_VAL([ac_cv_linux_func_i_lookup_takes_nameidata], [
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct inode _inode;
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_inode.i_op->lookup(&_inode, &_dentry, &_nameidata);],
+      ac_cv_linux_func_i_lookup_takes_nameidata=yes,
+      ac_cv_linux_func_i_lookup_takes_nameidata=no)])
+  AC_MSG_RESULT($ac_cv_linux_func_i_lookup_takes_nameidata)])
+
+
+AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
+  AC_MSG_CHECKING([whether inode_operations.permission takes a nameidata])
+  AC_CACHE_VAL([ac_cv_linux_func_i_permission_takes_nameidata], [
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct inode _inode;
+struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
+      ac_cv_linux_func_i_permission_takes_nameidata=yes,
+      ac_cv_linux_func_i_permission_takes_nameidata=no)])
+  AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)])
+
+
+AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA], [
+  AC_MSG_CHECKING([whether dentry_operations.d_revalidate takes a nameidata])
+  AC_CACHE_VAL([ac_cv_linux_func_d_revalidate_takes_nameidata], [
+    AC_TRY_KBUILD(
+[#include <linux/fs.h>
+#include <linux/namei.h>],
+[struct dentry _dentry;
+struct nameidata _nameidata;
+(void)_dentry.d_op->d_revalidate(&_dentry, &_nameidata);],
+      ac_cv_linux_func_d_revalidate_takes_nameidata=yes,
+      ac_cv_linux_func_d_revalidate_takes_nameidata=no)])
+  AC_MSG_RESULT($ac_cv_linux_func_d_revalidate_takes_nameidata)])