From 4ab59d7ee924a6be1d553f75a67b0b253cc85e88 Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Tue, 14 Aug 2012 18:08:51 -0400 Subject: [PATCH] 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. Reviewed-on: http://gerrit.openafs.org/7986 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit 7413cd09a53f89882a46fd100bf6c501348f2188) Change-Id: Ie68d70dcf414d24e7e980c8a8f35b83550d2da7c Reviewed-on: http://gerrit.openafs.org/8083 Reviewed-by: Ken Dreyer Tested-by: BuildBot Reviewed-by: Derrick Brashear --- acinclude.m4 | 1 + src/afs/LINUX/osi_vnodeops.c | 8 +++++++- src/cf/linux-test4.m4 | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index f77606279..c089e1397 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -964,6 +964,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 60a828e4d..03dcaf8a9 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -969,7 +969,9 @@ afs_linux_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *sta * later on, we shouldn't have to do it until later. Perhaps in the future.. */ 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) @@ -984,7 +986,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 AFS_GLOCK(); diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index dc30770bc..4a6ec025e 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -727,3 +727,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]) +]) -- 2.39.5