Linux 3.6: revalidate dentry op API change
authorMarc Dionne <marc.c.dionne@gmail.com>
Tue, 14 Aug 2012 22:08:51 +0000 (18:08 -0400)
committerDerrick Brashear <shadow@dementix.org>
Fri, 17 Aug 2012 18:15:21 +0000 (11:15 -0700)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

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

index f83569d..0483c7c 100644 (file)
@@ -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
index 3ce0170..e36475d 100644 (file)
@@ -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
 
index ae1a741..a99becb 100644 (file)
@@ -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 <linux/fs.h>
+                       #include <linux/namei.h>],
+                       [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])
+])