linux-page-follow-link-light-20041209
authorKris Van Hees <aedil@sinenomine.net>
Thu, 9 Dec 2004 16:16:55 +0000 (16:16 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 9 Dec 2004 16:16:55 +0000 (16:16 +0000)
FIXES 16742

new 2.6 uses page_follow_link_light
detect and use

acinclude.m4
src/afs/LINUX/osi_vnodeops.c
src/cf/linux-test3.m4

index e0d37ab..76ebe18 100644 (file)
@@ -564,6 +564,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_KERNEL_LINUX_SYSCALL_H
                 LINUX_KERNEL_SELINUX
                 LINUX_KERNEL_SOCK_CREATE
+                LINUX_KERNEL_PAGE_FOLLOW_LINK
                 LINUX_NEED_RHCONFIG
                 LINUX_RECALC_SIGPENDING_ARG_TYPE
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT
@@ -681,6 +682,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 if test "x$ac_cv_linux_kernel_sock_create_v" = "xyes" ; then
                  AC_DEFINE(LINUX_KERNEL_SOCK_CREATE_V, 1, [define if your linux kernel uses 5 arguments for sock_create])
                 fi
+                if test "x$ac_cv_linux_kernel_page_follow_link" = "xyes" ; then
+                 AC_DEFINE(HAVE_KERNEL_PAGE_FOLLOW_LINK, 1, [define if your linux kernel provides page_follow_link])
+                fi
                 if test "x$ac_linux_syscall" = "xyes" ; then
                  AC_DEFINE(HAVE_KERNEL_LINUX_SYSCALL_H, 1, [define if your linux kernel has linux/syscall.h])
                 fi
index d6c86da..e88b53a 100644 (file)
@@ -1840,7 +1840,11 @@ struct address_space_operations afs_symlink_aops = {
 struct inode_operations afs_symlink_iops = {
 #if defined(AFS_LINUX24_ENV)
   .readlink =          page_readlink,
+#if defined(HAVE_KERNEL_PAGE_FOLLOW_LINK)
   .follow_link =       page_follow_link,
+#else
+  .follow_link =       page_follow_link_light,
+#endif
   .setattr =           afs_notify_change,
 #else
   .readlink =          afs_linux_readlink,
index 177471e..f8c2151 100644 (file)
@@ -113,3 +113,18 @@ AC_TRY_COMPILE(
 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 -Werror-implicit-function-declaration -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"])