]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
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@your-file-system.com>
Sat, 29 Sep 2012 13:41:11 +0000 (06:41 -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.

Reviewed-on: http://gerrit.openafs.org/7986
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 7413cd09a53f89882a46fd100bf6c501348f2188)

Change-Id: Ie68d70dcf414d24e7e980c8a8f35b83550d2da7c
Reviewed-on: http://gerrit.openafs.org/8083
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
acinclude.m4
src/afs/LINUX/osi_vnodeops.c
src/cf/linux-test4.m4

index f776062790a624fad1f46fb25e86bd729a011720..c089e1397ea00f82662a5eddd1d145b0d198e595 100644 (file)
@@ -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
index 60a828e4d93a87a5f9a1e5013b6dc24ccb7b8895..03dcaf8a972765c94daca7ccfdbf8e5f469ec90b 100644 (file)
@@ -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();
index dc30770bc6a0dca56a3e96ab0da4c641b82fd08b..4a6ec025ee47151e09343f06f28ca4040c93e98a 100644 (file)
@@ -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 <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])
+])