]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
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)
committerStephan Wiesand <stephan.wiesand@desy.de>
Mon, 24 Nov 2014 09:16:21 +0000 (04:16 -0500)
d_invalidate is now defined as void and does not have
a return value to check.

Reviewed-on: http://gerrit.openafs.org/11562
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit a42f01d5ebb13da575b3123800ee6990743155ab)

Change-Id: I8542404771c4a7962238efd9a53d7dfcf4011c96
Reviewed-on: http://gerrit.openafs.org/11569
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
acinclude.m4
src/afs/LINUX/osi_compat.h
src/afs/LINUX/osi_vcache.c
src/cf/linux-test4.m4

index 13d70db2f9df1e4562cfa0f4d3414ee613498f58..b10cfb6f018a8ec18537dfff47f7d1ab174ae81c 100644 (file)
@@ -1024,6 +1024,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 c500c611f75c9c23c2960cd314d846c2d0605fb7..26673a7d4da071e335c206746c78a64de50e3975 100644 (file)
@@ -557,4 +557,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 99aab919de67b30ee1eb10ac789321f0a81982a2..1d0db82cc0ceda0ad79fb1abb493fcb004934f5a 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 1759d9e611cbacd3283027050bcaa8fa6858455b..34c5d4d04531b00f8936cbb3bff9d7c285094ed0 100644 (file)
@@ -786,3 +786,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],
+                      [])
+])