linux-hlist-unhashed-opencoding-20080520

LICENSE IPL10
FIXES 93871

if we can't use hlist_unhashed (which is dumb) or we don't have it (less dumb) work around it.

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
LICENSE IPL10
FIXES 93871

if we can't use hlist_unhashed (which is dumb) or we don't have it (less dumb) w
ork around it.
This commit is contained in:
Derrick Brashear 2008-05-20 22:02:49 +00:00
parent f00df529b7
commit c761f24839
3 changed files with 25 additions and 1 deletions

View File

@ -645,6 +645,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
@ -823,6 +824,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

View File

@ -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;

View File

@ -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 <linux/list.h>],
[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])