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 <pjoshi@stec-inc.com>
Closes #255
This commit is contained in:
Prasad Joshi
2011-06-25 13:30:29 +01:00
committed by Brian Behlendorf
parent 560bcf9d14
commit b312979252
59 changed files with 172 additions and 2 deletions
+12
View File
@@ -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])],
[])
])
+1
View File
@@ -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"