Skip to content

Commit 480bd56

Browse files
Colin Ian Kingtorvalds
authored andcommitted
ocfs2: make several functions and variables static (and some const)
There are a variety of functions and variables that are local to the source and do not need to be in global scope, so make them static. Also make a couple of char arrays static const. Cleans up sparse warnings: symbol 'o2hb_heartbeat_mode_desc' was not declared. Should it be static? symbol 'o2hb_heartbeat_mode' was not declared. Should it be static? symbol 'o2hb_dependent_users' was not declared. Should it be static? symbol 'o2hb_region_dec_user' was not declared. Should it be static? symbol 'o2nm_fence_method_desc' was not declared. Should it be static? symbol 'lockdep_keys' was not declared. Should it be static? Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Colin Ian King <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Junxiao Bi <[email protected]> Cc: Joseph Qi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 229ba1f commit 480bd56

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

fs/ocfs2/cluster/heartbeat.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,21 @@ enum o2hb_heartbeat_modes {
127127
O2HB_HEARTBEAT_NUM_MODES,
128128
};
129129

130-
char *o2hb_heartbeat_mode_desc[O2HB_HEARTBEAT_NUM_MODES] = {
131-
"local", /* O2HB_HEARTBEAT_LOCAL */
132-
"global", /* O2HB_HEARTBEAT_GLOBAL */
130+
static const char *o2hb_heartbeat_mode_desc[O2HB_HEARTBEAT_NUM_MODES] = {
131+
"local", /* O2HB_HEARTBEAT_LOCAL */
132+
"global", /* O2HB_HEARTBEAT_GLOBAL */
133133
};
134134

135135
unsigned int o2hb_dead_threshold = O2HB_DEFAULT_DEAD_THRESHOLD;
136-
unsigned int o2hb_heartbeat_mode = O2HB_HEARTBEAT_LOCAL;
136+
static unsigned int o2hb_heartbeat_mode = O2HB_HEARTBEAT_LOCAL;
137137

138138
/*
139139
* o2hb_dependent_users tracks the number of registered callbacks that depend
140140
* on heartbeat. o2net and o2dlm are two entities that register this callback.
141141
* However only o2dlm depends on the heartbeat. It does not want the heartbeat
142142
* to stop while a dlm domain is still active.
143143
*/
144-
unsigned int o2hb_dependent_users;
144+
static unsigned int o2hb_dependent_users;
145145

146146
/*
147147
* In global heartbeat mode, all regions are pinned if there are one or more
@@ -2486,7 +2486,7 @@ static int o2hb_region_inc_user(const char *region_uuid)
24862486
return ret;
24872487
}
24882488

2489-
void o2hb_region_dec_user(const char *region_uuid)
2489+
static void o2hb_region_dec_user(const char *region_uuid)
24902490
{
24912491
spin_lock(&o2hb_live_lock);
24922492

fs/ocfs2/cluster/nodemanager.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
* cluster references throughout where nodes are looked up */
3636
struct o2nm_cluster *o2nm_single_cluster = NULL;
3737

38-
char *o2nm_fence_method_desc[O2NM_FENCE_METHODS] = {
39-
"reset", /* O2NM_FENCE_RESET */
40-
"panic", /* O2NM_FENCE_PANIC */
38+
static const char *o2nm_fence_method_desc[O2NM_FENCE_METHODS] = {
39+
"reset", /* O2NM_FENCE_RESET */
40+
"panic", /* O2NM_FENCE_PANIC */
4141
};
4242

4343
static inline void o2nm_lock_subsystem(void);

fs/ocfs2/dlmglue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ struct ocfs2_unblock_ctl {
9696
};
9797

9898
/* Lockdep class keys */
99-
struct lock_class_key lockdep_keys[OCFS2_NUM_LOCK_TYPES];
99+
static struct lock_class_key lockdep_keys[OCFS2_NUM_LOCK_TYPES];
100100

101101
static int ocfs2_check_meta_downconvert(struct ocfs2_lock_res *lockres,
102102
int new_level);

0 commit comments

Comments
 (0)