Linux 3.5 compat, iops->truncate_range() removed

The vmtruncate_range() support has been removed from the kernel in
favor of using the fallocate method in the file_operations table.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #784
This commit is contained in:
Richard Yao
2012-07-23 11:11:25 -07:00
committed by Brian Behlendorf
parent 756c3e5a9c
commit ea1fdf46e2
60 changed files with 225 additions and 0 deletions
+4
View File
@@ -328,6 +328,7 @@ out:
return (error);
}
#ifdef HAVE_INODE_TRUNCATE_RANGE
static void
zpl_truncate_range(struct inode* ip, loff_t start, loff_t end)
{
@@ -354,6 +355,7 @@ zpl_truncate_range(struct inode* ip, loff_t start, loff_t end)
crfree(cr);
}
#endif /* HAVE_INODE_TRUNCATE_RANGE */
#ifdef HAVE_INODE_FALLOCATE
static long
@@ -379,7 +381,9 @@ const struct inode_operations zpl_inode_operations = {
.getxattr = generic_getxattr,
.removexattr = generic_removexattr,
.listxattr = zpl_xattr_list,
#ifdef HAVE_INODE_TRUNCATE_RANGE
.truncate_range = zpl_truncate_range,
#endif /* HAVE_INODE_TRUNCATE_RANGE */
#ifdef HAVE_INODE_FALLOCATE
.fallocate = zpl_fallocate,
#endif /* HAVE_INODE_FALLOCATE */