Documentation: add description of phy for sdhci-of-arasan
[firefly-linux-kernel-4.4.55.git] / fs / hfsplus / extents.c
index a7aafb35b6243d17f3bc23d2e22ad3a9e4de5a8b..feca524ce2a5c7d6034bf0a528679fe923381507 100644 (file)
@@ -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);
@@ -436,10 +436,9 @@ int hfsplus_file_extend(struct inode *inode)
        if (sbi->alloc_file->i_size * 8 <
            sbi->total_blocks - sbi->free_blocks + 8) {
                /* extend alloc file */
-               pr_err("extend alloc file! "
-                               "(%llu,%u,%u)\n",
-                       sbi->alloc_file->i_size * 8,
-                       sbi->total_blocks, sbi->free_blocks);
+               pr_err("extend alloc file! (%llu,%u,%u)\n",
+                      sbi->alloc_file->i_size * 8,
+                      sbi->total_blocks, sbi->free_blocks);
                return -ENOSPC;
        }
 
@@ -463,6 +462,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) {