]> git.proxmox.com Git - mirror_zfs.git/blobdiff - module/zfs/zpl_inode.c
Support the fallocate() file operation.
[mirror_zfs.git] / module / zfs / zpl_inode.c
index 2d197a4880722a197a6cb1bb9c208982b37cc4e4..9b5533755985845b5d6cbf3f7c5204ee2965111a 100644 (file)
@@ -342,6 +342,15 @@ zpl_truncate_range(struct inode* ip, loff_t start, loff_t end)
        crfree(cr);
 }
 
+#ifdef HAVE_INODE_FALLOCATE
+static long
+zpl_fallocate(struct inode *ip, int mode, loff_t offset, loff_t len)
+{
+       return zpl_fallocate_common(ip, mode, offset, len);
+}
+#endif /* HAVE_INODE_FALLOCATE */
+
+
 const struct inode_operations zpl_inode_operations = {
        .create         = zpl_create,
        .link           = zpl_link,
@@ -358,6 +367,9 @@ const struct inode_operations zpl_inode_operations = {
        .removexattr    = generic_removexattr,
        .listxattr      = zpl_xattr_list,
        .truncate_range = zpl_truncate_range,
+#ifdef HAVE_INODE_FALLOCATE
+       .fallocate      = zpl_fallocate,
+#endif /* HAVE_INODE_FALLOCATE */
 };
 
 const struct inode_operations zpl_dir_inode_operations = {