|
@@ -294,6 +294,18 @@ static sector_t _fat_bmap(struct address_space *mapping, sector_t block)
|
|
|
return blocknr;
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * fat_block_truncate_page() zeroes out a mapping from file offset `from'
|
|
|
+ * up to the end of the block which corresponds to `from'.
|
|
|
+ * This is required during truncate to physically zeroout the tail end
|
|
|
+ * of that block so it doesn't yield old data if the file is later grown.
|
|
|
+ * Also, avoid causing failure from fsx for cases of "data past EOF"
|
|
|
+ */
|
|
|
+int fat_block_truncate_page(struct inode *inode, loff_t from)
|
|
|
+{
|
|
|
+ return block_truncate_page(inode->i_mapping, from, fat_get_block);
|
|
|
+}
|
|
|
+
|
|
|
static const struct address_space_operations fat_aops = {
|
|
|
.readpage = fat_readpage,
|
|
|
.readpages = fat_readpages,
|