diff options
Diffstat (limited to 'fs/hfsplus/extents.c')
| -rw-r--r-- | fs/hfsplus/extents.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c index a7aafb35b624..feca524ce2a5 100644 --- a/fs/hfsplus/extents.c +++ b/fs/hfsplus/extents.c | |||
| @@ -235,7 +235,7 @@ int hfsplus_get_block(struct inode *inode, sector_t iblock, | |||
| 235 | if (iblock > hip->fs_blocks || !create) | 235 | if (iblock > hip->fs_blocks || !create) |
| 236 | return -EIO; | 236 | return -EIO; |
| 237 | if (ablock >= hip->alloc_blocks) { | 237 | if (ablock >= hip->alloc_blocks) { |
| 238 | res = hfsplus_file_extend(inode); | 238 | res = hfsplus_file_extend(inode, false); |
| 239 | if (res) | 239 | if (res) |
| 240 | return res; | 240 | return res; |
| 241 | } | 241 | } |
| @@ -425,7 +425,7 @@ int hfsplus_free_fork(struct super_block *sb, u32 cnid, | |||
| 425 | return res; | 425 | return res; |
| 426 | } | 426 | } |
| 427 | 427 | ||
| 428 | int hfsplus_file_extend(struct inode *inode) | 428 | int hfsplus_file_extend(struct inode *inode, bool zeroout) |
| 429 | { | 429 | { |
| 430 | struct super_block *sb = inode->i_sb; | 430 | struct super_block *sb = inode->i_sb; |
| 431 | struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb); | 431 | struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb); |
| @@ -436,10 +436,9 @@ int hfsplus_file_extend(struct inode *inode) | |||
| 436 | if (sbi->alloc_file->i_size * 8 < | 436 | if (sbi->alloc_file->i_size * 8 < |
| 437 | sbi->total_blocks - sbi->free_blocks + 8) { | 437 | sbi->total_blocks - sbi->free_blocks + 8) { |
| 438 | /* extend alloc file */ | 438 | /* extend alloc file */ |
| 439 | pr_err("extend alloc file! " | 439 | pr_err("extend alloc file! (%llu,%u,%u)\n", |
| 440 | "(%llu,%u,%u)\n", | 440 | sbi->alloc_file->i_size * 8, |
| 441 | sbi->alloc_file->i_size * 8, | 441 | sbi->total_blocks, sbi->free_blocks); |
| 442 | sbi->total_blocks, sbi->free_blocks); | ||
| 443 | return -ENOSPC; | 442 | return -ENOSPC; |
| 444 | } | 443 | } |
| 445 | 444 | ||
| @@ -463,6 +462,12 @@ int hfsplus_file_extend(struct inode *inode) | |||
| 463 | } | 462 | } |
| 464 | } | 463 | } |
| 465 | 464 | ||
| 465 | if (zeroout) { | ||
| 466 | res = sb_issue_zeroout(sb, start, len, GFP_NOFS); | ||
| 467 | if (res) | ||
| 468 | goto out; | ||
| 469 | } | ||
| 470 | |||
| 466 | hfs_dbg(EXTENT, "extend %lu: %u,%u\n", inode->i_ino, start, len); | 471 | hfs_dbg(EXTENT, "extend %lu: %u,%u\n", inode->i_ino, start, len); |
| 467 | 472 | ||
| 468 | if (hip->alloc_blocks <= hip->first_blocks) { | 473 | if (hip->alloc_blocks <= hip->first_blocks) { |
