|
@@ -3322,26 +3322,6 @@ void ext4_set_aops(struct inode *inode)
|
|
|
inode->i_mapping->a_ops = &ext4_aops;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
- * ext4_block_truncate_page() zeroes out a mapping from file offset `from'
|
|
|
- * up to the end of the block which corresponds to `from'.
|
|
|
- * This required during truncate. We need to physically zero the tail end
|
|
|
- * of that block so it doesn't yield old data if the file is later grown.
|
|
|
- */
|
|
|
-int ext4_block_truncate_page(handle_t *handle,
|
|
|
- struct address_space *mapping, loff_t from)
|
|
|
-{
|
|
|
- unsigned offset = from & (PAGE_CACHE_SIZE-1);
|
|
|
- unsigned length;
|
|
|
- unsigned blocksize;
|
|
|
- struct inode *inode = mapping->host;
|
|
|
-
|
|
|
- blocksize = inode->i_sb->s_blocksize;
|
|
|
- length = blocksize - (offset & (blocksize - 1));
|
|
|
-
|
|
|
- return ext4_block_zero_page_range(handle, mapping, from, length);
|
|
|
-}
|
|
|
-
|
|
|
/*
|
|
|
* ext4_block_zero_page_range() zeros out a mapping of length 'length'
|
|
|
* starting from file offset 'from'. The range to be zero'd must
|
|
@@ -3349,7 +3329,7 @@ int ext4_block_truncate_page(handle_t *handle,
|
|
|
* the end of the block it will be shortened to end of the block
|
|
|
* that cooresponds to 'from'
|
|
|
*/
|
|
|
-int ext4_block_zero_page_range(handle_t *handle,
|
|
|
+static int ext4_block_zero_page_range(handle_t *handle,
|
|
|
struct address_space *mapping, loff_t from, loff_t length)
|
|
|
{
|
|
|
ext4_fsblk_t index = from >> PAGE_CACHE_SHIFT;
|
|
@@ -3439,6 +3419,26 @@ unlock:
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * ext4_block_truncate_page() zeroes out a mapping from file offset `from'
|
|
|
+ * up to the end of the block which corresponds to `from'.
|
|
|
+ * This required during truncate. We need to physically zero the tail end
|
|
|
+ * of that block so it doesn't yield old data if the file is later grown.
|
|
|
+ */
|
|
|
+int ext4_block_truncate_page(handle_t *handle,
|
|
|
+ struct address_space *mapping, loff_t from)
|
|
|
+{
|
|
|
+ unsigned offset = from & (PAGE_CACHE_SIZE-1);
|
|
|
+ unsigned length;
|
|
|
+ unsigned blocksize;
|
|
|
+ struct inode *inode = mapping->host;
|
|
|
+
|
|
|
+ blocksize = inode->i_sb->s_blocksize;
|
|
|
+ length = blocksize - (offset & (blocksize - 1));
|
|
|
+
|
|
|
+ return ext4_block_zero_page_range(handle, mapping, from, length);
|
|
|
+}
|
|
|
+
|
|
|
int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode,
|
|
|
loff_t lstart, loff_t length)
|
|
|
{
|