]> granicus.if.org Git - zfs/commitdiff
Handle any invalidate_inodes_check prototype.
authorEtienne Dechamps <e-t172@akegroup.org>
Thu, 2 Aug 2012 13:33:31 +0000 (15:33 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 6 Aug 2012 18:39:49 +0000 (11:39 -0700)
In the comments of commit 723aa3b0c2eed070f7eeadd2ce2d87f46da6d0f8,
mmatuska reported that the test for invalidate_inodes_check() is broken
if invalidate_inodes() takes two arguments.

This patch fixes the issue by resorting to another approach for
detecting invalidate_inodes_check(): is simply checks if
invalidate_inodes is defined as a macro. If it is, then it concludes
that invalidate_inodes_check() is available. This will continue to work
even if the prototype of invalidate_inodes_check() changes over time.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #148

config/spl-build.m4
configure

index 7ec81e7131e992e079fccff67110148f1153575c..d7c89bc48968992b15da395fe7bcf9b402d43f3d 100644 (file)
@@ -2072,9 +2072,10 @@ AC_DEFUN([SPL_AC_KERNEL_INVALIDATE_INODES], [
        AC_MSG_CHECKING([whether invalidate_inodes_check() is available])
        SPL_LINUX_TRY_COMPILE_SYMBOL([
                #include <linux/fs.h>
-       ], [
-               invalidate_inodes_check(NULL, 0);
-       ], [invalidate_inodes_check], [], [
+               #ifndef invalidate_inodes
+               #error invalidate_inodes is not a macro
+               #endif
+       ], [ ], [invalidate_inodes_check], [], [
                AC_MSG_RESULT(yes)
                AC_DEFINE(HAVE_INVALIDATE_INODES_CHECK, 1,
                          [invalidate_inodes_check() is available])
index 1ca8e847f078501a2afbc4540ff5073d8768ace2..bbaedb0530e60554c4494b7b2727113c7ecbbbeb 100755 (executable)
--- a/configure
+++ b/configure
@@ -17147,13 +17147,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 
                #include <linux/fs.h>
+               #ifndef invalidate_inodes
+               #error invalidate_inodes is not a macro
+               #endif
 
 int
 main (void)
 {
 
-               invalidate_inodes_check(NULL, 0);
-
   ;
   return 0;
 }
@@ -23343,13 +23344,14 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 
                #include <linux/fs.h>
+               #ifndef invalidate_inodes
+               #error invalidate_inodes is not a macro
+               #endif
 
 int
 main (void)
 {
 
-               invalidate_inodes_check(NULL, 0);
-
   ;
   return 0;
 }