update atomically-set-inode-flags
[ext4-patch-queue.git] / make-ext4_block_zero_page_range_static
blob314e54b9c2ae91e724a059095152e7f25267d3b6
1 ext4: make ext4_block_zero_page_range static
3 From: Matthew Wilcox <matthew.r.wilcox@intel.com>
5 It's only called within inode.c, so make it static, remove its prototype
6 from ext4.h and move it above all of its callers so it doesn't need a
7 prototype within inode.c.
9 Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
10 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
11 ---
12  fs/ext4/ext4.h  |  2 --
13  fs/ext4/inode.c | 42 +++++++++++++++++++++---------------------
14  2 files changed, 21 insertions(+), 23 deletions(-)
16 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
17 index d3a534f..e025c29 100644
18 --- a/fs/ext4/ext4.h
19 +++ b/fs/ext4/ext4.h
20 @@ -2133,8 +2133,6 @@ extern int ext4_writepage_trans_blocks(struct inode *);
21  extern int ext4_chunk_trans_blocks(struct inode *, int nrblocks);
22  extern int ext4_block_truncate_page(handle_t *handle,
23                 struct address_space *mapping, loff_t from);
24 -extern int ext4_block_zero_page_range(handle_t *handle,
25 -               struct address_space *mapping, loff_t from, loff_t length);
26  extern int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode,
27                              loff_t lstart, loff_t lend);
28  extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);
29 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
30 index 6e39895..ce7341c 100644
31 --- a/fs/ext4/inode.c
32 +++ b/fs/ext4/inode.c
33 @@ -3312,33 +3312,13 @@ void ext4_set_aops(struct inode *inode)
34  }
36  /*
37 - * ext4_block_truncate_page() zeroes out a mapping from file offset `from'
38 - * up to the end of the block which corresponds to `from'.
39 - * This required during truncate. We need to physically zero the tail end
40 - * of that block so it doesn't yield old data if the file is later grown.
41 - */
42 -int ext4_block_truncate_page(handle_t *handle,
43 -               struct address_space *mapping, loff_t from)
45 -       unsigned offset = from & (PAGE_CACHE_SIZE-1);
46 -       unsigned length;
47 -       unsigned blocksize;
48 -       struct inode *inode = mapping->host;
50 -       blocksize = inode->i_sb->s_blocksize;
51 -       length = blocksize - (offset & (blocksize - 1));
53 -       return ext4_block_zero_page_range(handle, mapping, from, length);
56 -/*
57   * ext4_block_zero_page_range() zeros out a mapping of length 'length'
58   * starting from file offset 'from'.  The range to be zero'd must
59   * be contained with in one block.  If the specified range exceeds
60   * the end of the block it will be shortened to end of the block
61   * that cooresponds to 'from'
62   */
63 -int ext4_block_zero_page_range(handle_t *handle,
64 +static int ext4_block_zero_page_range(handle_t *handle,
65                 struct address_space *mapping, loff_t from, loff_t length)
66  {
67         ext4_fsblk_t index = from >> PAGE_CACHE_SHIFT;
68 @@ -3428,6 +3408,26 @@ unlock:
69         return err;
70  }
72 +/*
73 + * ext4_block_truncate_page() zeroes out a mapping from file offset `from'
74 + * up to the end of the block which corresponds to `from'.
75 + * This required during truncate. We need to physically zero the tail end
76 + * of that block so it doesn't yield old data if the file is later grown.
77 + */
78 +int ext4_block_truncate_page(handle_t *handle,
79 +               struct address_space *mapping, loff_t from)
81 +       unsigned offset = from & (PAGE_CACHE_SIZE-1);
82 +       unsigned length;
83 +       unsigned blocksize;
84 +       struct inode *inode = mapping->host;
86 +       blocksize = inode->i_sb->s_blocksize;
87 +       length = blocksize - (offset & (blocksize - 1));
89 +       return ext4_block_zero_page_range(handle, mapping, from, length);
92  int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode,
93                              loff_t lstart, loff_t length)
94  {
95 -- 
96 1.9.0
99 To unsubscribe, send a message with 'unsubscribe linux-mm' in
100 the body to majordomo@kvack.org.  For more info on Linux MM,
101 see: http://www.linux-mm.org/ .
102 Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>