|
@@ -235,7 +235,7 @@ int hfsplus_get_block(struct inode *inode, sector_t iblock,
|
|
|
if (iblock > hip->fs_blocks || !create)
|
|
|
return -EIO;
|
|
|
if (ablock >= hip->alloc_blocks) {
|
|
|
- res = hfsplus_file_extend(inode);
|
|
|
+ res = hfsplus_file_extend(inode, false);
|
|
|
if (res)
|
|
|
return res;
|
|
|
}
|
|
@@ -425,7 +425,7 @@ int hfsplus_free_fork(struct super_block *sb, u32 cnid,
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
-int hfsplus_file_extend(struct inode *inode)
|
|
|
+int hfsplus_file_extend(struct inode *inode, bool zeroout)
|
|
|
{
|
|
|
struct super_block *sb = inode->i_sb;
|
|
|
struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb);
|
|
@@ -463,6 +463,12 @@ int hfsplus_file_extend(struct inode *inode)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (zeroout) {
|
|
|
+ res = sb_issue_zeroout(sb, start, len, GFP_NOFS);
|
|
|
+ if (res)
|
|
|
+ goto out;
|
|
|
+ }
|
|
|
+
|
|
|
hfs_dbg(EXTENT, "extend %lu: %u,%u\n", inode->i_ino, start, len);
|
|
|
|
|
|
if (hip->alloc_blocks <= hip->first_blocks) {
|