summaryrefslogtreecommitdiffstats
path: root/config/kernel-truncate-setsize.m4
diff options
context:
space:
mode:
authorPrasad Joshi <[email protected]>2011-06-25 13:30:29 +0100
committerBrian Behlendorf <[email protected]>2011-06-27 09:59:19 -0700
commitb312979252c5b566d2f59febcda67f309637e18c (patch)
tree7a9950357582ef20835f99fb565da1cef12fd135 /config/kernel-truncate-setsize.m4
parent560bcf9d14a63e2cef4dd49d61399c8a865c1348 (diff)
Tear down and flush the mmap region
The inode eviction should unmap the pages associated with the inode. These pages should also be flushed to disk to avoid the data loss. Therefore, use truncate_setsize() in evict_inode() to release the pagecache. The API truncate_setsize() was added in 2.6.35 kernel. To ensure compatibility with the old kernel, the patch defines its own truncate_setsize function. Signed-off-by: Prasad Joshi <[email protected]> Closes #255
Diffstat (limited to 'config/kernel-truncate-setsize.m4')
-rw-r--r--config/kernel-truncate-setsize.m412
1 files changed, 12 insertions, 0 deletions
diff --git a/config/kernel-truncate-setsize.m4 b/config/kernel-truncate-setsize.m4
new file mode 100644
index 000000000..d8b2b47bd
--- /dev/null
+++ b/config/kernel-truncate-setsize.m4
@@ -0,0 +1,12 @@
+dnl #
+dnl # 2.6.35 API change
+dnl # Added truncate_setsize() helper function.
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_TRUNCATE_SETSIZE], [
+ ZFS_CHECK_SYMBOL_EXPORT(
+ [truncate_setsize],
+ [mm/truncate.c],
+ [AC_DEFINE(HAVE_TRUNCATE_SETSIZE, 1,
+ [truncate_setsize() is available])],
+ [])
+])