Let compiler decide what to do with static functions Also fix the following checkpatch warnings: WARNING: line over 80 characters +static unsigned int gfs2_extent_length(void *start, unsigned int len, __be64 *ptr, size_t limit, int *eob)
WARNING: Prefer 'unsigned int' to bare use of 'unsigned' +static void gfs2_update_stats(struct gfs2_lkstats *s, unsigned index, Inspired-by: "David S. Miller" <da...@davemloft.net> Signed-off-by: Fabian Frederick <f...@skynet.be> --- fs/gfs2/bmap.c | 15 ++++++++------- fs/gfs2/dir.c | 4 ++-- fs/gfs2/glock.c | 8 ++++---- fs/gfs2/lock_dlm.c | 6 +++--- fs/gfs2/log.c | 6 +++--- fs/gfs2/quota.c | 4 ++-- fs/gfs2/rgrp.c | 12 ++++++------ fs/gfs2/xattr.c | 2 +- 8 files changed, 29 insertions(+), 28 deletions(-) diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 6e2bec1..194a7dc 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -245,7 +245,7 @@ static void find_metapath(const struct gfs2_sbd *sdp, u64 block, } -static inline unsigned int metapath_branch_start(const struct metapath *mp) +static unsigned int metapath_branch_start(const struct metapath *mp) { if (mp->mp_list[0] == 0) return 2; @@ -262,7 +262,7 @@ static inline unsigned int metapath_branch_start(const struct metapath *mp) * metadata tree. */ -static inline __be64 *metapointer(unsigned int height, const struct metapath *mp) +static __be64 *metapointer(unsigned int height, const struct metapath *mp) { struct buffer_head *bh = mp->mp_bh[height]; unsigned int head_size = (height > 0) ? @@ -334,7 +334,7 @@ static int lookup_metapath(struct gfs2_inode *ip, struct metapath *mp) return ip->i_height; } -static inline void release_metapath(struct metapath *mp) +static void release_metapath(struct metapath *mp) { int i; @@ -360,7 +360,8 @@ static inline void release_metapath(struct metapath *mp) * Returns: The length of the extent (minimum of one block) */ -static inline unsigned int gfs2_extent_length(void *start, unsigned int len, __be64 *ptr, size_t limit, int *eob) +static unsigned int gfs2_extent_length(void *start, unsigned int len, + __be64 *ptr, size_t limit, int *eob) { const __be64 *end = (start + len); const __be64 *first = ptr; @@ -381,7 +382,7 @@ static inline unsigned int gfs2_extent_length(void *start, unsigned int len, __b return (ptr - first); } -static inline void bmap_lock(struct gfs2_inode *ip, int create) +static void bmap_lock(struct gfs2_inode *ip, int create) { if (create) down_write(&ip->i_rw_mutex); @@ -389,7 +390,7 @@ static inline void bmap_lock(struct gfs2_inode *ip, int create) down_read(&ip->i_rw_mutex); } -static inline void bmap_unlock(struct gfs2_inode *ip, int create) +static void bmap_unlock(struct gfs2_inode *ip, int create) { if (create) up_write(&ip->i_rw_mutex); @@ -397,7 +398,7 @@ static inline void bmap_unlock(struct gfs2_inode *ip, int create) up_read(&ip->i_rw_mutex); } -static inline __be64 *gfs2_indirect_init(struct metapath *mp, +static __be64 *gfs2_indirect_init(struct metapath *mp, struct gfs2_glock *gl, unsigned int i, unsigned offset, u64 bn) { diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index fcb59b2..8551eb0 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c @@ -400,12 +400,12 @@ void gfs2_dir_hash_inval(struct gfs2_inode *ip) kvfree(hc); } -static inline int gfs2_dirent_sentinel(const struct gfs2_dirent *dent) +static int gfs2_dirent_sentinel(const struct gfs2_dirent *dent) { return dent->de_inum.no_addr == 0 || dent->de_inum.no_formal_ino == 0; } -static inline int __gfs2_dirent_find(const struct gfs2_dirent *dent, +static int __gfs2_dirent_find(const struct gfs2_dirent *dent, const struct qstr *name, int ret) { if (!gfs2_dirent_sentinel(dent) && diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 3a90b2b..28885dd 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -185,7 +185,7 @@ void gfs2_glock_put(struct gfs2_glock *gl) * Returns: true if its ok to grant the lock */ -static inline int may_grant(const struct gfs2_glock *gl, const struct gfs2_holder *gh) +static int may_grant(const struct gfs2_glock *gl, const struct gfs2_holder *gh) { const struct gfs2_holder *gh_head = list_entry(gl->gl_holders.next, const struct gfs2_holder, gh_list); if ((gh->gh_state == LM_ST_EXCLUSIVE || @@ -296,7 +296,7 @@ restart: * @gl: the glock */ -static inline struct gfs2_holder *find_first_waiter(const struct gfs2_glock *gl) +static struct gfs2_holder *find_first_waiter(const struct gfs2_glock *gl) { struct gfs2_holder *gh; @@ -500,7 +500,7 @@ __acquires(&gl->gl_lockref.lock) * @gl: the glock */ -static inline struct gfs2_holder *find_first_holder(const struct gfs2_glock *gl) +static struct gfs2_holder *find_first_holder(const struct gfs2_glock *gl) { struct gfs2_holder *gh; @@ -882,7 +882,7 @@ void gfs2_print_dbg(struct seq_file *seq, const char *fmt, ...) * */ -static inline void add_to_queue(struct gfs2_holder *gh) +static void add_to_queue(struct gfs2_holder *gh) __releases(&gl->gl_lockref.lock) __acquires(&gl->gl_lockref.lock) { diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c index 8b907c5..197f698 100644 --- a/fs/gfs2/lock_dlm.c +++ b/fs/gfs2/lock_dlm.c @@ -44,7 +44,7 @@ extern struct workqueue_struct *gfs2_control_wq; * they are not scaled fixed point. */ -static inline void gfs2_update_stats(struct gfs2_lkstats *s, unsigned index, +static void gfs2_update_stats(struct gfs2_lkstats *s, unsigned int index, s64 sample) { s64 delta = sample - s->stats[index]; @@ -70,7 +70,7 @@ static inline void gfs2_update_stats(struct gfs2_lkstats *s, unsigned index, * TRY_1CB flags are set are classified as non-blocking. All * other DLM requests are counted as (potentially) blocking. */ -static inline void gfs2_update_reply_times(struct gfs2_glock *gl) +static void gfs2_update_reply_times(struct gfs2_glock *gl) { struct gfs2_pcpu_lkstats *lks; const unsigned gltype = gl->gl_name.ln_type; @@ -97,7 +97,7 @@ static inline void gfs2_update_reply_times(struct gfs2_glock *gl) * each dlm call. */ -static inline void gfs2_update_request_times(struct gfs2_glock *gl) +static void gfs2_update_request_times(struct gfs2_glock *gl) { struct gfs2_pcpu_lkstats *lks; const unsigned gltype = gl->gl_name.ln_type; diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index e58ccef0..8aa303e 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -401,7 +401,7 @@ retry: * Returns: the distance in blocks */ -static inline unsigned int log_distance(struct gfs2_sbd *sdp, unsigned int newer, +static unsigned int log_distance(struct gfs2_sbd *sdp, unsigned int newer, unsigned int older) { int dist; @@ -889,12 +889,12 @@ void gfs2_log_shutdown(struct gfs2_sbd *sdp) sdp->sd_log_tail = sdp->sd_log_head; } -static inline int gfs2_jrnl_flush_reqd(struct gfs2_sbd *sdp) +static int gfs2_jrnl_flush_reqd(struct gfs2_sbd *sdp) { return (atomic_read(&sdp->sd_log_pinned) >= atomic_read(&sdp->sd_log_thresh1)); } -static inline int gfs2_ail_flush_reqd(struct gfs2_sbd *sdp) +static int gfs2_ail_flush_reqd(struct gfs2_sbd *sdp) { unsigned int used_blocks = sdp->sd_jdesc->jd_blocks - atomic_read(&sdp->sd_log_blks_free); return used_blocks >= atomic_read(&sdp->sd_log_thresh2); diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 77930ca..2fcd9c1 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -96,12 +96,12 @@ static unsigned int gfs2_qd_hash(const struct gfs2_sbd *sdp, return h & GFS2_QD_HASH_MASK; } -static inline void spin_lock_bucket(unsigned int hash) +static void spin_lock_bucket(unsigned int hash) { hlist_bl_lock(&qd_hash_table[hash]); } -static inline void spin_unlock_bucket(unsigned int hash) +static void spin_unlock_bucket(unsigned int hash) { hlist_bl_unlock(&qd_hash_table[hash]); } diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 86ccc015..90a178d 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -84,7 +84,7 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minext, * */ -static inline void gfs2_setbit(const struct gfs2_rbm *rbm, bool do_clone, +static void gfs2_setbit(const struct gfs2_rbm *rbm, bool do_clone, unsigned char new_state) { unsigned char *byte1, *byte2, *end, cur_state; @@ -126,7 +126,7 @@ static inline void gfs2_setbit(const struct gfs2_rbm *rbm, bool do_clone, * Returns: The two bit block state of the requested bit */ -static inline u8 gfs2_testbit(const struct gfs2_rbm *rbm) +static u8 gfs2_testbit(const struct gfs2_rbm *rbm) { struct gfs2_bitmap *bi = rbm_bi(rbm); const u8 *buffer = bi->bi_bh->b_data + bi->bi_offset; @@ -157,7 +157,7 @@ static inline u8 gfs2_testbit(const struct gfs2_rbm *rbm) * single test (on 64 bit arches). */ -static inline u64 gfs2_bit_search(const __le64 *ptr, u64 mask, u8 state) +static u64 gfs2_bit_search(const __le64 *ptr, u64 mask, u8 state) { u64 tmp; static const u64 search[] = { @@ -182,7 +182,7 @@ static inline u64 gfs2_bit_search(const __le64 *ptr, u64 mask, u8 state) * -1 if the block range is before the start of the reservation * 0 if the block range overlaps with the reservation */ -static inline int rs_cmp(u64 blk, u32 len, struct gfs2_blkreserv *rs) +static int rs_cmp(u64 blk, u32 len, struct gfs2_blkreserv *rs) { u64 startblk = gfs2_rbm_to_block(&rs->rs_rbm); @@ -483,7 +483,7 @@ void gfs2_rgrp_verify(struct gfs2_rgrpd *rgd) } } -static inline int rgrp_contains_block(struct gfs2_rgrpd *rgd, u64 block) +static int rgrp_contains_block(struct gfs2_rgrpd *rgd, u64 block) { u64 first = rgd->rd_data0; u64 last = first + rgd->rd_data; @@ -1935,7 +1935,7 @@ static bool gfs2_select_rgrp(struct gfs2_rgrpd **pos, const struct gfs2_rgrpd *b * If this is one of our preferred rgrps, it should be quicker to acquire, * because we tried to set ourselves up as dlm lock master. */ -static inline int fast_to_acquire(struct gfs2_rgrpd *rgd) +static int fast_to_acquire(struct gfs2_rgrpd *rgd) { struct gfs2_glock *gl = rgd->rd_gl; diff --git a/fs/gfs2/xattr.c b/fs/gfs2/xattr.c index 3a28535..4b7802c 100644 --- a/fs/gfs2/xattr.c +++ b/fs/gfs2/xattr.c @@ -348,7 +348,7 @@ struct ea_list { unsigned int ei_size; }; -static inline unsigned int gfs2_ea_strlen(struct gfs2_ea_header *ea) +static unsigned int gfs2_ea_strlen(struct gfs2_ea_header *ea) { switch (ea->ea_type) { case GFS2_EATYPE_USR: -- 2.8.1