From: Marc Dionne Date: Tue, 14 Aug 2012 22:08:51 +0000 (-0400) Subject: Linux 3.6: revalidate dentry op API change X-Git-Tag: openafs-stable-1_8_0pre1~2079 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=7413cd09a53f89882a46fd100bf6c501348f2188 Linux 3.6: revalidate dentry op API change The nameidata argument is dropped, replaced by an unsigned flags value. The configure test is very specific; kernels with the older API with a signed int flags value should fall through. Change-Id: I5939b089b023fe81e3824ac3f920c4b6a261d39a Reviewed-on: http://gerrit.openafs.org/7986 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- diff --git a/acinclude.m4 b/acinclude.m4 index f83569d..0483c7c 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -979,6 +979,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) LINUX_DENTRY_OPEN_TAKES_PATH LINUX_D_ALIAS_IS_HLIST LINUX_IOP_I_CREATE_TAKES_BOOL + LINUX_DOP_D_REVALIDATE_TAKES_UNSIGNED dnl If we are guaranteed that keyrings will work - that is dnl a) The kernel has keyrings enabled diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 3ce0170..e36475d 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1045,7 +1045,9 @@ afs_linux_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *sta * The code here assumes that on entry the global lock is not held */ static int -#ifdef DOP_REVALIDATE_TAKES_NAMEIDATA +#if defined(DOP_REVALIDATE_TAKES_UNSIGNED) +afs_linux_dentry_revalidate(struct dentry *dp, unsigned int flags) +#elif defined(DOP_REVALIDATE_TAKES_NAMEIDATA) afs_linux_dentry_revalidate(struct dentry *dp, struct nameidata *nd) #else afs_linux_dentry_revalidate(struct dentry *dp, int flags) @@ -1061,7 +1063,11 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags) #ifdef LOOKUP_RCU /* We don't support RCU path walking */ +# if defined(DOP_REVALIDATE_TAKES_UNSIGNED) + if (flags & LOOKUP_RCU) +# else if (nd->flags & LOOKUP_RCU) +# endif return -ECHILD; #endif diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index ae1a741..a99becb 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -717,3 +717,17 @@ AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_BOOL], [ [define if your iops.create takes a bool argument], [-Werror]) ]) + + +AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_UNSIGNED], [ + AC_CHECK_LINUX_BUILD([whether dentry_operations.d_revalidate takes an unsigned int], + [ac_cv_linux_func_d_revalidate_takes_unsigned], + [#include + #include ], + [struct dentry_operations dops; + int reval(struct dentry *d, unsigned int i) { return 0; }; + dops.d_revalidate = reval;], + [DOP_REVALIDATE_TAKES_UNSIGNED], + [define if your dops.d_revalidate takes an unsigned int argument], + [-Werror]) +])