Linux 3.18: d_invalidate can no longer return an error
authorMarc Dionne <marc.dionne@your-file-system.com>
Thu, 23 Oct 2014 15:12:57 +0000 (11:12 -0400)
committerD Brashear <shadow@your-file-system.com>
Fri, 31 Oct 2014 12:37:48 +0000 (08:37 -0400)
d_invalidate is now defined as void and does not have
a return value to check.

Change-Id: Ief1b562db63877dde9f4a8ac4918b727a05b23bb
Reviewed-on: http://gerrit.openafs.org/11562
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

acinclude.m4
src/afs/LINUX/osi_compat.h
src/afs/LINUX/osi_vcache.c
src/cf/linux-test4.m4

index 7040e19..549eea3 100644 (file)
@@ -1073,6 +1073,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_IOP_I_CREATE_TAKES_BOOL
                 LINUX_DOP_D_REVALIDATE_TAKES_UNSIGNED
                 LINUX_IOP_LOOKUP_TAKES_UNSIGNED
+                LINUX_D_INVALIDATE_IS_VOID
 
                 dnl If we are guaranteed that keyrings will work - that is
                 dnl  a) The kernel has keyrings enabled
index e9e5076..57f6ea7 100644 (file)
@@ -610,4 +610,15 @@ afs_maybe_shrink_dcache(struct dentry *dp)
 #endif
 }
 
+static inline int
+afs_d_invalidate(struct dentry *dp)
+{
+#if defined(D_INVALIDATE_IS_VOID)
+    d_invalidate(dp);
+    return 0;
+#else
+    return d_invalidate(dp);
+#endif
+}
+
 #endif /* AFS_LINUX_OSI_COMPAT_H */
index 99aab91..1d0db82 100644 (file)
@@ -13,6 +13,8 @@
 #include "afs/sysincludes.h"    /*Standard vendor system headers */
 #include "afsincludes.h"        /*AFS-based standard headers */
 
+#include "osi_compat.h"
+
 int
 osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) {
     int code;
@@ -71,7 +73,7 @@ restart:
            dget(dentry);
 
            spin_unlock(&inode->i_lock);
-           if (d_invalidate(dentry) == -EBUSY) {
+           if (afs_d_invalidate(dentry) == -EBUSY) {
                dput(dentry);
                /* perhaps lock and try to continue? (use cur as head?) */
                goto inuse;
index 228b491..f0269b3 100644 (file)
@@ -776,3 +776,16 @@ AC_DEFUN([LINUX_IOP_LOOKUP_TAKES_UNSIGNED], [
                       [define if your iops.lookup takes an unsigned int argument],
                       [-Werror])
 ])
+
+
+AC_DEFUN([LINUX_D_INVALIDATE_IS_VOID], [
+  AC_CHECK_LINUX_BUILD([whether d_invalidate returns void],
+                       [ac_cv_linux_func_d_invalidate_returns_void],
+                       [#include <linux/fs.h>],
+                       [
+                       void d_invalidate(struct dentry *);
+                       ],
+                      [D_INVALIDATE_IS_VOID],
+                      [define if your d_invalidate returns void],
+                      [])
+])