Linux 3.5 compat, iops->truncate_range() removed
[zfs.git] / module / zfs / zpl_inode.c
index ea8c309..0dab82c 100644 (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 */