diff --git a/acinclude.m4 b/acinclude.m4 index 36df23026c..65808c0636 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -660,6 +660,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_KERNEL_SELINUX LINUX_KERNEL_SOCK_CREATE LINUX_KERNEL_PAGE_FOLLOW_LINK + LINUX_KERNEL_HLIST_UNHASHED LINUX_KEY_TYPE_H_EXISTS LINUX_NEED_RHCONFIG LINUX_RECALC_SIGPENDING_ARG_TYPE @@ -838,6 +839,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) 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_cv_linux_kernel_page_follow_link" = "xyes" ; then + AC_DEFINE(HAVE_KERNEL_HLIST_UNHASHED, 1, [define if your linux kernel provides hlist_unhashed]) + 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 diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 4b12d6d6d7..ef57f2ef26 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1033,7 +1033,15 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp) ip = AFSTOV(vcp); afs_getattr(vcp, &vattr, credp); afs_fill_inode(ip, &vattr); - if (hlist_unhashed(&ip->i_hash)) + if ( +#ifdef HAVE_KERNEL_HLIST_UNHASHED + hlist_unhashed(&ip->i_hash) +#elif defined(AFS_LINUX26_ENV) + ip->i_hash.pprev == NULL +#else + ip->i_hash.prev == NULL +#endif + ) insert_inode_hash(ip); } dp->d_op = &afs_dentry_operations; diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 448d55143b..f14d5f8e76 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -511,6 +511,18 @@ AC_DEFUN([LINUX_KERNEL_PAGE_FOLLOW_LINK], [ CPPFLAGS="$save_CPPFLAGS"]) AC_MSG_RESULT($ac_cv_linux_kernel_page_follow_link)]) +AC_DEFUN([LINUX_KERNEL_HLIST_UNHASHED], [ + AC_MSG_CHECKING([for hlist_unhashed]) + AC_CACHE_VAL([ac_cv_linux_kernel_hlist_unhashed], [ + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration" + AC_TRY_KBUILD( +[#include ], +[hlist_unhashed(0);], + ac_cv_linux_kernel_hlist_unhashed=yes, + ac_cv_linux_kernel_hlist_unhashed=no) + CPPFLAGS="$save_CPPFLAGS"]) + AC_MSG_RESULT($ac_cv_linux_kernel_hlist_unhashed)]) AC_DEFUN([LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK], [ AC_MSG_CHECKING([for gfp_mask in struct address_space])