diff options
author | Prasad Joshi <[email protected]> | 2011-06-25 13:30:29 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-06-27 09:59:19 -0700 |
commit | b312979252c5b566d2f59febcda67f309637e18c (patch) | |
tree | 7a9950357582ef20835f99fb565da1cef12fd135 /config | |
parent | 560bcf9d14a63e2cef4dd49d61399c8a865c1348 (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')
-rw-r--r-- | config/kernel-truncate-setsize.m4 | 12 | ||||
-rw-r--r-- | config/kernel.m4 | 1 |
2 files changed, 13 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])], + []) +]) diff --git a/config/kernel.m4 b/config/kernel.m4 index 0ccae33fa..67f6bc5d3 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -37,6 +37,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [ ZFS_AC_KERNEL_INSERT_INODE_LOCKED ZFS_AC_KERNEL_D_OBTAIN_ALIAS ZFS_AC_KERNEL_CHECK_DISK_SIZE_CHANGE + ZFS_AC_KERNEL_TRUNCATE_SETSIZE if test "$LINUX_OBJ" != "$LINUX"; then KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ" |