]> git.proxmox.com Git - mirror_spl.git/blobdiff - config/spl-build.m4
Linux 2.6.39 compat, invalidate_inodes()
[mirror_spl.git] / config / spl-build.m4
index 94c7f3e7460382433bf4cb673cb3d87ba372a9f6..84fbb8b926cf896c82044b88cf27f188e3553edb 100644 (file)
@@ -76,6 +76,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
        SPL_AC_3ARGS_FILE_FSYNC
        SPL_AC_EXPORTED_RWSEM_IS_LOCKED
        SPL_AC_KERNEL_INVALIDATE_INODES
+       SPL_AC_KERNEL_2ARGS_INVALIDATE_INODES
        SPL_AC_SHRINK_DCACHE_MEMORY
        SPL_AC_SHRINK_ICACHE_MEMORY
 ])
@@ -1720,6 +1721,36 @@ AC_DEFUN([SPL_AC_KERNEL_INVALIDATE_INODES], [
                [])
 ])
 
+dnl #
+dnl # 2.6.39 API compat,
+dnl # The function invalidate_inodes() now take 2 arguments.  The second
+dnl # 'kill_dirty' argument describes how invalidate_inodes() should
+dnl # handle dirty inodes.  Only when set will dirty inodes be discarded,
+dnl # otherwise they will be handled as busy.
+dnl #
+dnl # Unfortunately, we don't have access to the invalidate_inodes()
+dnl # prototype so it's not easy to check how many arguments it takes.
+dnl # However, this change was done for the benefit of invalidate_device()
+dnl # which also added an argument.  The invalidate_device() symbol does
+dnl # exist in the development headers so if it takes two arguments we
+dnl # can fairly safely infer that invalidate_inodes() takes two arguments
+dnl # as well.  See commit 93b270f76e7ef3b81001576860c2701931cdc78b.
+dnl #
+AC_DEFUN([SPL_AC_KERNEL_2ARGS_INVALIDATE_INODES],
+       [AC_MSG_CHECKING([whether invalidate_inodes() wants 2 args])
+       SPL_LINUX_TRY_COMPILE([
+               #include <linux/fs.h>
+       ],[
+               return __invalidate_device(NULL, 0);
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_2ARGS_INVALIDATE_INODES, 1,
+                         [invalidate_inodes() wants 2 args])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+])
+
 dnl #
 dnl # 2.6.xx API compat,
 dnl # There currently exists no exposed API to partially shrink the dcache.