aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew.r.wilcox@intel.com>2014-03-24 15:09:16 -0400
committerTheodore Ts'o <tytso@mit.edu>2014-03-24 15:09:16 -0400
commit94350ab5c34166f08ef67aaca3a01e6b420891c9 (patch)
treea36a7cbfeb049f7f3426a44347c527810fe74b9a /fs/ext4/inode.c
parent5f16f3225b06242a9ee876f07c1c9b6ed36a22b6 (diff)
ext4: make ext4_block_zero_page_range static
It's only called within inode.c, so make it static, remove its prototype from ext4.h and move it above all of its callers so it doesn't need a prototype within inode.c. Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index df067c3c6c93..f03a9e7094bc 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -3323,33 +3323,13 @@ void ext4_set_aops(struct inode *inode)
3323} 3323}
3324 3324
3325/* 3325/*
3326 * ext4_block_truncate_page() zeroes out a mapping from file offset `from'
3327 * up to the end of the block which corresponds to `from'.
3328 * This required during truncate. We need to physically zero the tail end
3329 * of that block so it doesn't yield old data if the file is later grown.
3330 */
3331int ext4_block_truncate_page(handle_t *handle,
3332 struct address_space *mapping, loff_t from)
3333{
3334 unsigned offset = from & (PAGE_CACHE_SIZE-1);
3335 unsigned length;
3336 unsigned blocksize;
3337 struct inode *inode = mapping->host;
3338
3339 blocksize = inode->i_sb->s_blocksize;
3340 length = blocksize - (offset & (blocksize - 1));
3341
3342 return ext4_block_zero_page_range(handle, mapping, from, length);
3343}
3344
3345/*
3346 * ext4_block_zero_page_range() zeros out a mapping of length 'length' 3326 * ext4_block_zero_page_range() zeros out a mapping of length 'length'
3347 * starting from file offset 'from'. The range to be zero'd must 3327 * starting from file offset 'from'. The range to be zero'd must
3348 * be contained with in one block. If the specified range exceeds 3328 * be contained with in one block. If the specified range exceeds
3349 * the end of the block it will be shortened to end of the block 3329 * the end of the block it will be shortened to end of the block
3350 * that cooresponds to 'from' 3330 * that cooresponds to 'from'
3351 */ 3331 */
3352int ext4_block_zero_page_range(handle_t *handle, 3332static int ext4_block_zero_page_range(handle_t *handle,
3353 struct address_space *mapping, loff_t from, loff_t length) 3333 struct address_space *mapping, loff_t from, loff_t length)
3354{ 3334{
3355 ext4_fsblk_t index = from >> PAGE_CACHE_SHIFT; 3335 ext4_fsblk_t index = from >> PAGE_CACHE_SHIFT;
@@ -3439,6 +3419,26 @@ unlock:
3439 return err; 3419 return err;
3440} 3420}
3441 3421
3422/*
3423 * ext4_block_truncate_page() zeroes out a mapping from file offset `from'
3424 * up to the end of the block which corresponds to `from'.
3425 * This required during truncate. We need to physically zero the tail end
3426 * of that block so it doesn't yield old data if the file is later grown.
3427 */
3428int ext4_block_truncate_page(handle_t *handle,
3429 struct address_space *mapping, loff_t from)
3430{
3431 unsigned offset = from & (PAGE_CACHE_SIZE-1);
3432 unsigned length;
3433 unsigned blocksize;
3434 struct inode *inode = mapping->host;
3435
3436 blocksize = inode->i_sb->s_blocksize;
3437 length = blocksize - (offset & (blocksize - 1));
3438
3439 return ext4_block_zero_page_range(handle, mapping, from, length);
3440}
3441
3442int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode, 3442int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode,
3443 loff_t lstart, loff_t length) 3443 loff_t lstart, loff_t length)
3444{ 3444{