aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorPrasad Joshi <pjoshi@stec-inc.com>2011-06-25 13:30:29 +0100
committerBrian Behlendorf <behlendorf1@llnl.gov>2011-06-27 09:59:19 -0700
commitb312979252c5b566d2f59febcda67f309637e18c (patch)
tree7a9950357582ef20835f99fb565da1cef12fd135 /module
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 <pjoshi@stec-inc.com> Closes #255
Diffstat (limited to 'module')
-rw-r--r--module/zfs/zpl_super.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/module/zfs/zpl_super.c b/module/zfs/zpl_super.c
index 493783213..304f708c3 100644
--- a/module/zfs/zpl_super.c
+++ b/module/zfs/zpl_super.c
@@ -73,7 +73,7 @@ zpl_inode_destroy(struct inode *ip)
static void
zpl_evict_inode(struct inode *ip)
{
- truncate_inode_pages(&ip->i_data, 0);
+ truncate_setsize(ip, 0);
end_writeback(ip);
zfs_inactive(ip);
}
@@ -89,7 +89,7 @@ zpl_clear_inode(struct inode *ip)
static void
zpl_inode_delete(struct inode *ip)
{
- truncate_inode_pages(&ip->i_data, 0);
+ truncate_setsize(ip, 0);
clear_inode(ip);
}