Skip to content

Commit 2fcd380

Browse files
author
Andreas Gruenbacher
committed
gfs2: No longer use 'extern' in function declarations
JIRA: https://issues.redhat.com/browse/RHEL-88093 Upstream Status: https://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2.git For non-static function declarations, external linkage is implied and the 'extern' keyword isn't needed. Some static checkers complain about the overuse of 'extern', so clean up all the function declarations. In addition, remove 'extern' from the definition of free_local_statfs_inodes(); it isn't needed there, either. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> (cherry picked from commit 0b2355f)
1 parent 818e414 commit 2fcd380

File tree

19 files changed

+293
-289
lines changed

19 files changed

+293
-289
lines changed

fs/gfs2/acl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
#define GFS2_ACL_MAX_ENTRIES(sdp) ((300 << (sdp)->sd_sb.sb_bsize_shift) >> 12)
1313

14-
extern struct posix_acl *gfs2_get_acl(struct inode *inode, int type, bool rcu);
15-
extern int __gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type);
16-
extern int gfs2_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
17-
struct posix_acl *acl, int type);
14+
struct posix_acl *gfs2_get_acl(struct inode *inode, int type, bool rcu);
15+
int __gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type);
16+
int gfs2_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
17+
struct posix_acl *acl, int type);
1818

1919
#endif /* __ACL_DOT_H__ */

fs/gfs2/aops.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include "incore.h"
1010

11-
extern void adjust_fs_space(struct inode *inode);
12-
extern void gfs2_page_add_databufs(struct gfs2_inode *ip, struct page *page,
13-
unsigned int from, unsigned int len);
11+
void adjust_fs_space(struct inode *inode);
12+
void gfs2_page_add_databufs(struct gfs2_inode *ip, struct page *page,
13+
unsigned int from, unsigned int len);
1414

1515
#endif /* __AOPS_DOT_H__ */

fs/gfs2/bmap.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,25 @@ static inline void gfs2_write_calc_reserv(const struct gfs2_inode *ip,
4646
extern const struct iomap_ops gfs2_iomap_ops;
4747
extern const struct iomap_writeback_ops gfs2_writeback_ops;
4848

49-
extern int gfs2_unstuff_dinode(struct gfs2_inode *ip);
50-
extern int gfs2_block_map(struct inode *inode, sector_t lblock,
51-
struct buffer_head *bh, int create);
52-
extern int gfs2_iomap_get(struct inode *inode, loff_t pos, loff_t length,
53-
struct iomap *iomap);
54-
extern int gfs2_iomap_alloc(struct inode *inode, loff_t pos, loff_t length,
55-
struct iomap *iomap);
56-
extern int gfs2_get_extent(struct inode *inode, u64 lblock, u64 *dblock,
57-
unsigned int *extlen);
58-
extern int gfs2_alloc_extent(struct inode *inode, u64 lblock, u64 *dblock,
59-
unsigned *extlen, bool *new);
60-
extern int gfs2_setattr_size(struct inode *inode, u64 size);
61-
extern void gfs2_trim_blocks(struct inode *inode);
62-
extern int gfs2_truncatei_resume(struct gfs2_inode *ip);
63-
extern int gfs2_file_dealloc(struct gfs2_inode *ip);
64-
extern int gfs2_write_alloc_required(struct gfs2_inode *ip, u64 offset,
65-
unsigned int len);
66-
extern int gfs2_map_journal_extents(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd);
67-
extern void gfs2_free_journal_extents(struct gfs2_jdesc *jd);
68-
extern int __gfs2_punch_hole(struct file *file, loff_t offset, loff_t length);
49+
int gfs2_unstuff_dinode(struct gfs2_inode *ip);
50+
int gfs2_block_map(struct inode *inode, sector_t lblock,
51+
struct buffer_head *bh, int create);
52+
int gfs2_iomap_get(struct inode *inode, loff_t pos, loff_t length,
53+
struct iomap *iomap);
54+
int gfs2_iomap_alloc(struct inode *inode, loff_t pos, loff_t length,
55+
struct iomap *iomap);
56+
int gfs2_get_extent(struct inode *inode, u64 lblock, u64 *dblock,
57+
unsigned int *extlen);
58+
int gfs2_alloc_extent(struct inode *inode, u64 lblock, u64 *dblock,
59+
unsigned *extlen, bool *new);
60+
int gfs2_setattr_size(struct inode *inode, u64 size);
61+
void gfs2_trim_blocks(struct inode *inode);
62+
int gfs2_truncatei_resume(struct gfs2_inode *ip);
63+
int gfs2_file_dealloc(struct gfs2_inode *ip);
64+
int gfs2_write_alloc_required(struct gfs2_inode *ip, u64 offset,
65+
unsigned int len);
66+
int gfs2_map_journal_extents(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd);
67+
void gfs2_free_journal_extents(struct gfs2_jdesc *jd);
68+
int __gfs2_punch_hole(struct file *file, loff_t offset, loff_t length);
6969

7070
#endif /* __BMAP_DOT_H__ */

fs/gfs2/dir.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,32 @@ struct gfs2_diradd {
2323
int save_loc;
2424
};
2525

26-
extern struct inode *gfs2_dir_search(struct inode *dir,
27-
const struct qstr *filename,
28-
bool fail_on_exist);
29-
extern int gfs2_dir_check(struct inode *dir, const struct qstr *filename,
30-
const struct gfs2_inode *ip);
31-
extern int gfs2_dir_add(struct inode *inode, const struct qstr *filename,
32-
const struct gfs2_inode *ip, struct gfs2_diradd *da);
26+
struct inode *gfs2_dir_search(struct inode *dir,
27+
const struct qstr *filename,
28+
bool fail_on_exist);
29+
int gfs2_dir_check(struct inode *dir, const struct qstr *filename,
30+
const struct gfs2_inode *ip);
31+
int gfs2_dir_add(struct inode *inode, const struct qstr *filename,
32+
const struct gfs2_inode *ip, struct gfs2_diradd *da);
3333
static inline void gfs2_dir_no_add(struct gfs2_diradd *da)
3434
{
3535
brelse(da->bh);
3636
da->bh = NULL;
3737
}
38-
extern int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry);
39-
extern int gfs2_dir_read(struct inode *inode, struct dir_context *ctx,
40-
struct file_ra_state *f_ra);
41-
extern int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename,
42-
const struct gfs2_inode *nip, unsigned int new_type);
38+
int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry);
39+
int gfs2_dir_read(struct inode *inode, struct dir_context *ctx,
40+
struct file_ra_state *f_ra);
41+
int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename,
42+
const struct gfs2_inode *nip, unsigned int new_type);
4343

44-
extern int gfs2_dir_exhash_dealloc(struct gfs2_inode *dip);
44+
int gfs2_dir_exhash_dealloc(struct gfs2_inode *dip);
4545

46-
extern int gfs2_diradd_alloc_required(struct inode *dir,
47-
const struct qstr *filename,
48-
struct gfs2_diradd *da);
49-
extern int gfs2_dir_get_new_buffer(struct gfs2_inode *ip, u64 block,
50-
struct buffer_head **bhp);
51-
extern void gfs2_dir_hash_inval(struct gfs2_inode *ip);
46+
int gfs2_diradd_alloc_required(struct inode *dir,
47+
const struct qstr *filename,
48+
struct gfs2_diradd *da);
49+
int gfs2_dir_get_new_buffer(struct gfs2_inode *ip, u64 block,
50+
struct buffer_head **bhp);
51+
void gfs2_dir_hash_inval(struct gfs2_inode *ip);
5252

5353
static inline u32 gfs2_disk_hash(const char *data, int len)
5454
{

fs/gfs2/glock.h

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -182,40 +182,40 @@ static inline struct address_space *gfs2_glock2aspace(struct gfs2_glock *gl)
182182
return NULL;
183183
}
184184

185-
extern int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
186-
const struct gfs2_glock_operations *glops,
187-
int create, struct gfs2_glock **glp);
188-
extern struct gfs2_glock *gfs2_glock_hold(struct gfs2_glock *gl);
189-
extern void gfs2_glock_put(struct gfs2_glock *gl);
190-
extern void gfs2_glock_put_async(struct gfs2_glock *gl);
191-
192-
extern void __gfs2_holder_init(struct gfs2_glock *gl, unsigned int state,
193-
u16 flags, struct gfs2_holder *gh,
194-
unsigned long ip);
185+
int gfs2_glock_get(struct gfs2_sbd *sdp, u64 number,
186+
const struct gfs2_glock_operations *glops,
187+
int create, struct gfs2_glock **glp);
188+
struct gfs2_glock *gfs2_glock_hold(struct gfs2_glock *gl);
189+
void gfs2_glock_put(struct gfs2_glock *gl);
190+
void gfs2_glock_put_async(struct gfs2_glock *gl);
191+
192+
void __gfs2_holder_init(struct gfs2_glock *gl, unsigned int state,
193+
u16 flags, struct gfs2_holder *gh,
194+
unsigned long ip);
195195
static inline void gfs2_holder_init(struct gfs2_glock *gl, unsigned int state,
196196
u16 flags, struct gfs2_holder *gh) {
197197
__gfs2_holder_init(gl, state, flags, gh, _RET_IP_);
198198
}
199199

200-
extern void gfs2_holder_reinit(unsigned int state, u16 flags,
201-
struct gfs2_holder *gh);
202-
extern void gfs2_holder_uninit(struct gfs2_holder *gh);
203-
extern int gfs2_glock_nq(struct gfs2_holder *gh);
204-
extern int gfs2_glock_poll(struct gfs2_holder *gh);
205-
extern int gfs2_instantiate(struct gfs2_holder *gh);
206-
extern int gfs2_glock_holder_ready(struct gfs2_holder *gh);
207-
extern int gfs2_glock_wait(struct gfs2_holder *gh);
208-
extern int gfs2_glock_async_wait(unsigned int num_gh, struct gfs2_holder *ghs);
209-
extern void gfs2_glock_dq(struct gfs2_holder *gh);
210-
extern void gfs2_glock_dq_wait(struct gfs2_holder *gh);
211-
extern void gfs2_glock_dq_uninit(struct gfs2_holder *gh);
212-
extern int gfs2_glock_nq_num(struct gfs2_sbd *sdp, u64 number,
213-
const struct gfs2_glock_operations *glops,
214-
unsigned int state, u16 flags,
215-
struct gfs2_holder *gh);
216-
extern int gfs2_glock_nq_m(unsigned int num_gh, struct gfs2_holder *ghs);
217-
extern void gfs2_glock_dq_m(unsigned int num_gh, struct gfs2_holder *ghs);
218-
extern void gfs2_dump_glock(struct seq_file *seq, struct gfs2_glock *gl,
200+
void gfs2_holder_reinit(unsigned int state, u16 flags,
201+
struct gfs2_holder *gh);
202+
void gfs2_holder_uninit(struct gfs2_holder *gh);
203+
int gfs2_glock_nq(struct gfs2_holder *gh);
204+
int gfs2_glock_poll(struct gfs2_holder *gh);
205+
int gfs2_instantiate(struct gfs2_holder *gh);
206+
int gfs2_glock_holder_ready(struct gfs2_holder *gh);
207+
int gfs2_glock_wait(struct gfs2_holder *gh);
208+
int gfs2_glock_async_wait(unsigned int num_gh, struct gfs2_holder *ghs);
209+
void gfs2_glock_dq(struct gfs2_holder *gh);
210+
void gfs2_glock_dq_wait(struct gfs2_holder *gh);
211+
void gfs2_glock_dq_uninit(struct gfs2_holder *gh);
212+
int gfs2_glock_nq_num(struct gfs2_sbd *sdp, u64 number,
213+
const struct gfs2_glock_operations *glops,
214+
unsigned int state, u16 flags,
215+
struct gfs2_holder *gh);
216+
int gfs2_glock_nq_m(unsigned int num_gh, struct gfs2_holder *ghs);
217+
void gfs2_glock_dq_m(unsigned int num_gh, struct gfs2_holder *ghs);
218+
void gfs2_dump_glock(struct seq_file *seq, struct gfs2_glock *gl,
219219
bool fsid);
220220
#define GLOCK_BUG_ON(gl,x) do { if (unlikely(x)) { \
221221
gfs2_dump_glock(NULL, gl, true); \
@@ -229,7 +229,7 @@ extern void gfs2_dump_glock(struct seq_file *seq, struct gfs2_glock *gl,
229229
gfs2_assert_withdraw((gl)->gl_name.ln_sbd, (x)); } } \
230230
while (0)
231231

232-
extern __printf(2, 3)
232+
__printf(2, 3)
233233
void gfs2_print_dbg(struct seq_file *seq, const char *fmt, ...);
234234

235235
/**
@@ -257,28 +257,28 @@ static inline int gfs2_glock_nq_init(struct gfs2_glock *gl,
257257
return error;
258258
}
259259

260-
extern void gfs2_glock_cb(struct gfs2_glock *gl, unsigned int state);
261-
extern void gfs2_glock_complete(struct gfs2_glock *gl, int ret);
262-
extern bool gfs2_queue_try_to_evict(struct gfs2_glock *gl);
263-
extern bool gfs2_queue_verify_delete(struct gfs2_glock *gl, bool later);
264-
extern void gfs2_cancel_delete_work(struct gfs2_glock *gl);
265-
extern void gfs2_flush_delete_work(struct gfs2_sbd *sdp);
266-
extern void gfs2_gl_hash_clear(struct gfs2_sbd *sdp);
267-
extern void gfs2_gl_dq_holders(struct gfs2_sbd *sdp);
268-
extern void gfs2_glock_thaw(struct gfs2_sbd *sdp);
269-
extern void gfs2_glock_free(struct gfs2_glock *gl);
270-
extern void gfs2_glock_free_later(struct gfs2_glock *gl);
271-
272-
extern int __init gfs2_glock_init(void);
273-
extern void gfs2_glock_exit(void);
274-
275-
extern void gfs2_create_debugfs_file(struct gfs2_sbd *sdp);
276-
extern void gfs2_delete_debugfs_file(struct gfs2_sbd *sdp);
277-
extern void gfs2_register_debugfs(void);
278-
extern void gfs2_unregister_debugfs(void);
279-
280-
extern void glock_set_object(struct gfs2_glock *gl, void *object);
281-
extern void glock_clear_object(struct gfs2_glock *gl, void *object);
260+
void gfs2_glock_cb(struct gfs2_glock *gl, unsigned int state);
261+
void gfs2_glock_complete(struct gfs2_glock *gl, int ret);
262+
bool gfs2_queue_try_to_evict(struct gfs2_glock *gl);
263+
bool gfs2_queue_verify_delete(struct gfs2_glock *gl, bool later);
264+
void gfs2_cancel_delete_work(struct gfs2_glock *gl);
265+
void gfs2_flush_delete_work(struct gfs2_sbd *sdp);
266+
void gfs2_gl_hash_clear(struct gfs2_sbd *sdp);
267+
void gfs2_gl_dq_holders(struct gfs2_sbd *sdp);
268+
void gfs2_glock_thaw(struct gfs2_sbd *sdp);
269+
void gfs2_glock_free(struct gfs2_glock *gl);
270+
void gfs2_glock_free_later(struct gfs2_glock *gl);
271+
272+
int __init gfs2_glock_init(void);
273+
void gfs2_glock_exit(void);
274+
275+
void gfs2_create_debugfs_file(struct gfs2_sbd *sdp);
276+
void gfs2_delete_debugfs_file(struct gfs2_sbd *sdp);
277+
void gfs2_register_debugfs(void);
278+
void gfs2_unregister_debugfs(void);
279+
280+
void glock_set_object(struct gfs2_glock *gl, void *object);
281+
void glock_clear_object(struct gfs2_glock *gl, void *object);
282282

283283
extern const struct lm_lockops gfs2_dlm_ops;
284284

@@ -297,8 +297,8 @@ static inline bool gfs2_holder_queued(struct gfs2_holder *gh)
297297
return !list_empty(&gh->gh_list);
298298
}
299299

300-
extern void gfs2_inode_remember_delete(struct gfs2_glock *gl, u64 generation);
301-
extern bool gfs2_inode_already_deleted(struct gfs2_glock *gl, u64 generation);
300+
void gfs2_inode_remember_delete(struct gfs2_glock *gl, u64 generation);
301+
bool gfs2_inode_already_deleted(struct gfs2_glock *gl, u64 generation);
302302

303303
static inline bool glock_needs_demote(struct gfs2_glock *gl)
304304
{

fs/gfs2/glops.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern const struct gfs2_glock_operations gfs2_quota_glops;
2222
extern const struct gfs2_glock_operations gfs2_journal_glops;
2323
extern const struct gfs2_glock_operations *gfs2_glops_list[];
2424

25-
extern int gfs2_inode_metasync(struct gfs2_glock *gl);
26-
extern void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync);
25+
int gfs2_inode_metasync(struct gfs2_glock *gl);
26+
void gfs2_ail_flush(struct gfs2_glock *gl, bool fsync);
2727

2828
#endif /* __GLOPS_DOT_H__ */

fs/gfs2/incore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ static inline void gfs2_sbstats_inc(const struct gfs2_glock *gl, int which)
864864
preempt_enable();
865865
}
866866

867-
extern struct gfs2_rgrpd *gfs2_glock2rgrp(struct gfs2_glock *gl);
867+
struct gfs2_rgrpd *gfs2_glock2rgrp(struct gfs2_glock *gl);
868868

869869
static inline unsigned gfs2_max_stuffed_size(const struct gfs2_inode *ip)
870870
{

fs/gfs2/inode.h

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#include "util.h"
1414

1515
bool gfs2_release_folio(struct folio *folio, gfp_t gfp_mask);
16-
extern int gfs2_internal_read(struct gfs2_inode *ip,
17-
char *buf, loff_t *pos, unsigned size);
18-
extern void gfs2_set_aops(struct inode *inode);
16+
int gfs2_internal_read(struct gfs2_inode *ip,
17+
char *buf, loff_t *pos, unsigned size);
18+
void gfs2_set_aops(struct inode *inode);
1919

2020
static inline int gfs2_is_stuffed(const struct gfs2_inode *ip)
2121
{
@@ -88,33 +88,33 @@ static inline int gfs2_check_internal_file_size(struct inode *inode,
8888
return -EIO;
8989
}
9090

91-
extern struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type,
92-
u64 no_addr, u64 no_formal_ino,
93-
unsigned int blktype);
94-
extern struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr,
95-
u64 no_formal_ino,
96-
unsigned int blktype);
97-
98-
extern int gfs2_inode_refresh(struct gfs2_inode *ip);
99-
100-
extern struct inode *gfs2_lookupi(struct inode *dir, const struct qstr *name,
101-
int is_root);
102-
extern int gfs2_permission(struct mnt_idmap *idmap,
103-
struct inode *inode, int mask);
104-
extern struct inode *gfs2_lookup_simple(struct inode *dip, const char *name);
105-
extern void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf);
106-
extern int gfs2_open_common(struct inode *inode, struct file *file);
107-
extern loff_t gfs2_seek_data(struct file *file, loff_t offset);
108-
extern loff_t gfs2_seek_hole(struct file *file, loff_t offset);
91+
struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned type,
92+
u64 no_addr, u64 no_formal_ino,
93+
unsigned int blktype);
94+
struct inode *gfs2_lookup_by_inum(struct gfs2_sbd *sdp, u64 no_addr,
95+
u64 no_formal_ino,
96+
unsigned int blktype);
97+
98+
int gfs2_inode_refresh(struct gfs2_inode *ip);
99+
100+
struct inode *gfs2_lookupi(struct inode *dir, const struct qstr *name,
101+
int is_root);
102+
int gfs2_permission(struct mnt_idmap *idmap,
103+
struct inode *inode, int mask);
104+
struct inode *gfs2_lookup_simple(struct inode *dip, const char *name);
105+
void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf);
106+
int gfs2_open_common(struct inode *inode, struct file *file);
107+
loff_t gfs2_seek_data(struct file *file, loff_t offset);
108+
loff_t gfs2_seek_hole(struct file *file, loff_t offset);
109109

110110
extern const struct file_operations gfs2_file_fops_nolock;
111111
extern const struct file_operations gfs2_dir_fops_nolock;
112112

113-
extern int gfs2_fileattr_get(struct dentry *dentry, struct fileattr *fa);
114-
extern int gfs2_fileattr_set(struct mnt_idmap *idmap,
115-
struct dentry *dentry, struct fileattr *fa);
116-
extern void gfs2_set_inode_flags(struct inode *inode);
117-
113+
int gfs2_fileattr_get(struct dentry *dentry, struct fileattr *fa);
114+
int gfs2_fileattr_set(struct mnt_idmap *idmap,
115+
struct dentry *dentry, struct fileattr *fa);
116+
void gfs2_set_inode_flags(struct inode *inode);
117+
118118
#ifdef CONFIG_GFS2_FS_LOCKING_DLM
119119
extern const struct file_operations gfs2_file_fops;
120120
extern const struct file_operations gfs2_dir_fops;

0 commit comments

Comments
 (0)