add patch fix-zeroing-of-page-during-writeback
[ext4-patch-queue.git] / make-local-functions-static
blob0585aa49eb6dc7e101ea61fd600393927e5405d4
1 ext4: make local functions static
3 From: Stephen Hemminger <stephen@networkplumber.org>
5 I have been running make namespacecheck to look for unneeded globals, and
6 found these in ext4.
8 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
9 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 ---
11  fs/ext4/balloc.c    | 21 +++++++++++----------
12  fs/ext4/ext4.h      | 26 --------------------------
13  fs/ext4/ext4_jbd2.c |  7 ++++---
14  fs/ext4/ext4_jbd2.h |  4 ----
15  fs/ext4/file.c      |  2 +-
16  fs/ext4/inline.c    | 10 +++++-----
17  fs/ext4/inode.c     |  2 +-
18  fs/ext4/mmp.c       |  4 ++--
19  fs/ext4/super.c     |  4 ++--
20  9 files changed, 26 insertions(+), 54 deletions(-)
22 diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
23 index 59c3ba8..0762d14 100644
24 --- a/fs/ext4/balloc.c
25 +++ b/fs/ext4/balloc.c
26 @@ -83,9 +83,9 @@ static inline int ext4_block_in_group(struct super_block *sb,
27  /* Return the number of clusters used for file system metadata; this
28   * represents the overhead needed by the file system.
29   */
30 -unsigned ext4_num_overhead_clusters(struct super_block *sb,
31 -                                   ext4_group_t block_group,
32 -                                   struct ext4_group_desc *gdp)
33 +static unsigned ext4_num_overhead_clusters(struct super_block *sb,
34 +                                          ext4_group_t block_group,
35 +                                          struct ext4_group_desc *gdp)
36  {
37         unsigned num_clusters;
38         int block_cluster = -1, inode_cluster = -1, itbl_cluster = -1, i, c;
39 @@ -176,9 +176,10 @@ static unsigned int num_clusters_in_group(struct super_block *sb,
40  }
42  /* Initializes an uninitialized block bitmap */
43 -void ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
44 -                           ext4_group_t block_group,
45 -                           struct ext4_group_desc *gdp)
46 +static void ext4_init_block_bitmap(struct super_block *sb,
47 +                                  struct buffer_head *bh,
48 +                                  ext4_group_t block_group,
49 +                                  struct ext4_group_desc *gdp)
50  {
51         unsigned int bit, bit_max;
52         struct ext4_sb_info *sbi = EXT4_SB(sb);
53 @@ -351,10 +352,10 @@ static ext4_fsblk_t ext4_valid_block_bitmap(struct super_block *sb,
54         return 0;
55  }
57 -void ext4_validate_block_bitmap(struct super_block *sb,
58 -                              struct ext4_group_desc *desc,
59 -                              ext4_group_t block_group,
60 -                              struct buffer_head *bh)
61 +static void ext4_validate_block_bitmap(struct super_block *sb,
62 +                                      struct ext4_group_desc *desc,
63 +                                      ext4_group_t block_group,
64 +                                      struct buffer_head *bh)
65  {
66         ext4_fsblk_t    blk;
67         struct ext4_group_info *grp = ext4_get_group_info(sb, block_group);
68 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
69 index 4feb2d5..1479e2a 100644
70 --- a/fs/ext4/ext4.h
71 +++ b/fs/ext4/ext4.h
72 @@ -1956,10 +1956,6 @@ extern void ext4_get_group_no_and_offset(struct super_block *sb,
73  extern ext4_group_t ext4_get_group_number(struct super_block *sb,
74                                           ext4_fsblk_t block);
76 -extern void ext4_validate_block_bitmap(struct super_block *sb,
77 -                                      struct ext4_group_desc *desc,
78 -                                      ext4_group_t block_group,
79 -                                      struct buffer_head *bh);
80  extern unsigned int ext4_block_group(struct super_block *sb,
81                         ext4_fsblk_t blocknr);
82  extern ext4_grpblk_t ext4_block_group_offset(struct super_block *sb,
83 @@ -1988,16 +1984,9 @@ extern int ext4_wait_block_bitmap(struct super_block *sb,
84                                   struct buffer_head *bh);
85  extern struct buffer_head *ext4_read_block_bitmap(struct super_block *sb,
86                                                   ext4_group_t block_group);
87 -extern void ext4_init_block_bitmap(struct super_block *sb,
88 -                                  struct buffer_head *bh,
89 -                                  ext4_group_t group,
90 -                                  struct ext4_group_desc *desc);
91  extern unsigned ext4_free_clusters_after_init(struct super_block *sb,
92                                               ext4_group_t block_group,
93                                               struct ext4_group_desc *gdp);
94 -extern unsigned ext4_num_overhead_clusters(struct super_block *sb,
95 -                                          ext4_group_t block_group,
96 -                                          struct ext4_group_desc *gdp);
97  ext4_fsblk_t ext4_inode_to_goal_block(struct inode *);
99  /* dir.c */
100 @@ -2140,8 +2129,6 @@ extern int ext4_alloc_da_blocks(struct inode *inode);
101  extern void ext4_set_aops(struct inode *inode);
102  extern int ext4_writepage_trans_blocks(struct inode *);
103  extern int ext4_chunk_trans_blocks(struct inode *, int nrblocks);
104 -extern int ext4_block_truncate_page(handle_t *handle,
105 -               struct address_space *mapping, loff_t from);
106  extern int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode,
107                              loff_t lstart, loff_t lend);
108  extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf);
109 @@ -2201,8 +2188,6 @@ extern int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count);
111  /* super.c */
112  extern int ext4_calculate_overhead(struct super_block *sb);
113 -extern int ext4_superblock_csum_verify(struct super_block *sb,
114 -                                      struct ext4_super_block *es);
115  extern void ext4_superblock_csum_set(struct super_block *sb);
116  extern void *ext4_kvmalloc(size_t size, gfp_t flags);
117  extern void *ext4_kvzalloc(size_t size, gfp_t flags);
118 @@ -2574,19 +2559,11 @@ extern const struct file_operations ext4_dir_operations;
119  extern const struct inode_operations ext4_file_inode_operations;
120  extern const struct file_operations ext4_file_operations;
121  extern loff_t ext4_llseek(struct file *file, loff_t offset, int origin);
122 -extern void ext4_unwritten_wait(struct inode *inode);
124  /* inline.c */
125  extern int ext4_has_inline_data(struct inode *inode);
126 -extern int ext4_get_inline_size(struct inode *inode);
127  extern int ext4_get_max_inline_size(struct inode *inode);
128  extern int ext4_find_inline_data_nolock(struct inode *inode);
129 -extern void ext4_write_inline_data(struct inode *inode,
130 -                                  struct ext4_iloc *iloc,
131 -                                  void *buffer, loff_t pos,
132 -                                  unsigned int len);
133 -extern int ext4_prepare_inline_data(handle_t *handle, struct inode *inode,
134 -                                   unsigned int len);
135  extern int ext4_init_inline_data(handle_t *handle, struct inode *inode,
136                                  unsigned int len);
137  extern int ext4_destroy_inline_data(handle_t *handle, struct inode *inode);
138 @@ -2779,9 +2756,6 @@ extern int ext4_bio_write_page(struct ext4_io_submit *io,
140  /* mmp.c */
141  extern int ext4_multi_mount_protect(struct super_block *, ext4_fsblk_t);
142 -extern void ext4_mmp_csum_set(struct super_block *sb, struct mmp_struct *mmp);
143 -extern int ext4_mmp_csum_verify(struct super_block *sb,
144 -                               struct mmp_struct *mmp);
146  /*
147   * Note that these flags will never ever appear in a buffer_head's state flag.
148 diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
149 index c3fb607..0074e0d 100644
150 --- a/fs/ext4/ext4_jbd2.c
151 +++ b/fs/ext4/ext4_jbd2.c
152 @@ -122,9 +122,10 @@ handle_t *__ext4_journal_start_reserved(handle_t *handle, unsigned int line,
153         return handle;
156 -void ext4_journal_abort_handle(const char *caller, unsigned int line,
157 -                              const char *err_fn, struct buffer_head *bh,
158 -                              handle_t *handle, int err)
159 +static void ext4_journal_abort_handle(const char *caller, unsigned int line,
160 +                                     const char *err_fn,
161 +                                     struct buffer_head *bh,
162 +                                     handle_t *handle, int err)
164         char nbuf[16];
165         const char *errstr = ext4_decode_error(NULL, err, nbuf);
166 diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h
167 index 81cfefa..17c00ff 100644
168 --- a/fs/ext4/ext4_jbd2.h
169 +++ b/fs/ext4/ext4_jbd2.h
170 @@ -231,10 +231,6 @@ int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode);
171  /*
172   * Wrapper functions with which ext4 calls into JBD.
173   */
174 -void ext4_journal_abort_handle(const char *caller, unsigned int line,
175 -                              const char *err_fn,
176 -               struct buffer_head *bh, handle_t *handle, int err);
178  int __ext4_journal_get_write_access(const char *where, unsigned int line,
179                                     handle_t *handle, struct buffer_head *bh);
181 diff --git a/fs/ext4/file.c b/fs/ext4/file.c
182 index 7d55a59..2389c4e 100644
183 --- a/fs/ext4/file.c
184 +++ b/fs/ext4/file.c
185 @@ -57,7 +57,7 @@ static int ext4_release_file(struct inode *inode, struct file *filp)
186         return 0;
189 -void ext4_unwritten_wait(struct inode *inode)
190 +static void ext4_unwritten_wait(struct inode *inode)
192         wait_queue_head_t *wq = ext4_ioend_wq(inode);
194 diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c
195 index 82edf5b..33dd704 100644
196 --- a/fs/ext4/inline.c
197 +++ b/fs/ext4/inline.c
198 @@ -22,7 +22,7 @@
199  #define EXT4_INLINE_DOTDOT_OFFSET      2
200  #define EXT4_INLINE_DOTDOT_SIZE                4
202 -int ext4_get_inline_size(struct inode *inode)
203 +static int ext4_get_inline_size(struct inode *inode)
205         if (EXT4_I(inode)->i_inline_off)
206                 return EXT4_I(inode)->i_inline_size;
207 @@ -211,8 +211,8 @@ out:
208   * value since it is already handled by ext4_xattr_ibody_inline_set.
209   * That saves us one memcpy.
210   */
211 -void ext4_write_inline_data(struct inode *inode, struct ext4_iloc *iloc,
212 -                           void *buffer, loff_t pos, unsigned int len)
213 +static void ext4_write_inline_data(struct inode *inode, struct ext4_iloc *iloc,
214 +                                  void *buffer, loff_t pos, unsigned int len)
216         struct ext4_xattr_entry *entry;
217         struct ext4_xattr_ibody_header *header;
218 @@ -373,8 +373,8 @@ out:
219         return error;
222 -int ext4_prepare_inline_data(handle_t *handle, struct inode *inode,
223 -                            unsigned int len)
224 +static int ext4_prepare_inline_data(handle_t *handle, struct inode *inode,
225 +                                   unsigned int len)
227         int ret, size;
228         struct ext4_inode_info *ei = EXT4_I(inode);
229 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
230 index 04dd2de..574c6dd 100644
231 --- a/fs/ext4/inode.c
232 +++ b/fs/ext4/inode.c
233 @@ -3443,7 +3443,7 @@ unlock:
234   * This required during truncate. We need to physically zero the tail end
235   * of that block so it doesn't yield old data if the file is later grown.
236   */
237 -int ext4_block_truncate_page(handle_t *handle,
238 +static int ext4_block_truncate_page(handle_t *handle,
239                 struct address_space *mapping, loff_t from)
241         unsigned offset = from & (PAGE_CACHE_SIZE-1);
242 diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
243 index 04434ad..32bce84 100644
244 --- a/fs/ext4/mmp.c
245 +++ b/fs/ext4/mmp.c
246 @@ -18,7 +18,7 @@ static __le32 ext4_mmp_csum(struct super_block *sb, struct mmp_struct *mmp)
247         return cpu_to_le32(csum);
250 -int ext4_mmp_csum_verify(struct super_block *sb, struct mmp_struct *mmp)
251 +static int ext4_mmp_csum_verify(struct super_block *sb, struct mmp_struct *mmp)
253         if (!EXT4_HAS_RO_COMPAT_FEATURE(sb,
254                                        EXT4_FEATURE_RO_COMPAT_METADATA_CSUM))
255 @@ -27,7 +27,7 @@ int ext4_mmp_csum_verify(struct super_block *sb, struct mmp_struct *mmp)
256         return mmp->mmp_checksum == ext4_mmp_csum(sb, mmp);
259 -void ext4_mmp_csum_set(struct super_block *sb, struct mmp_struct *mmp)
260 +static void ext4_mmp_csum_set(struct super_block *sb, struct mmp_struct *mmp)
262         if (!EXT4_HAS_RO_COMPAT_FEATURE(sb,
263                                        EXT4_FEATURE_RO_COMPAT_METADATA_CSUM))
264 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
265 index e38dd7d..b26a395 100644
266 --- a/fs/ext4/super.c
267 +++ b/fs/ext4/super.c
268 @@ -138,8 +138,8 @@ static __le32 ext4_superblock_csum(struct super_block *sb,
269         return cpu_to_le32(csum);
272 -int ext4_superblock_csum_verify(struct super_block *sb,
273 -                               struct ext4_super_block *es)
274 +static int ext4_superblock_csum_verify(struct super_block *sb,
275 +                                      struct ext4_super_block *es)
277         if (!EXT4_HAS_RO_COMPAT_FEATURE(sb,
278                                        EXT4_FEATURE_RO_COMPAT_METADATA_CSUM))