Skip to content

Commit 28928b2

Browse files
committed
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2: [PATCH 3/3] ocfs2/net: Silence build warnings [PATCH 2/3] ocfs2/dlm: Silence build warnings [PATCH 1/3] ocfs2/net: Silence build warnings ocfs2: Rename 'user_stack' plugin structure to 'ocfs2_user_plugin'
2 parents 63e1462 + 0f475b2 commit 28928b2

File tree

5 files changed

+70
-48
lines changed

5 files changed

+70
-48
lines changed

fs/ocfs2/cluster/tcp.c

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -142,53 +142,43 @@ static void o2net_idle_timer(unsigned long data);
142142
static void o2net_sc_postpone_idle(struct o2net_sock_container *sc);
143143
static void o2net_sc_reset_idle_timer(struct o2net_sock_container *sc);
144144

145-
static void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype,
146-
u32 msgkey, struct task_struct *task, u8 node)
147-
{
148145
#ifdef CONFIG_DEBUG_FS
146+
void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype,
147+
u32 msgkey, struct task_struct *task, u8 node)
148+
{
149149
INIT_LIST_HEAD(&nst->st_net_debug_item);
150150
nst->st_task = task;
151151
nst->st_msg_type = msgtype;
152152
nst->st_msg_key = msgkey;
153153
nst->st_node = node;
154-
#endif
155154
}
156155

157-
static void o2net_set_nst_sock_time(struct o2net_send_tracking *nst)
156+
void o2net_set_nst_sock_time(struct o2net_send_tracking *nst)
158157
{
159-
#ifdef CONFIG_DEBUG_FS
160158
do_gettimeofday(&nst->st_sock_time);
161-
#endif
162159
}
163160

164-
static void o2net_set_nst_send_time(struct o2net_send_tracking *nst)
161+
void o2net_set_nst_send_time(struct o2net_send_tracking *nst)
165162
{
166-
#ifdef CONFIG_DEBUG_FS
167163
do_gettimeofday(&nst->st_send_time);
168-
#endif
169164
}
170165

171-
static void o2net_set_nst_status_time(struct o2net_send_tracking *nst)
166+
void o2net_set_nst_status_time(struct o2net_send_tracking *nst)
172167
{
173-
#ifdef CONFIG_DEBUG_FS
174168
do_gettimeofday(&nst->st_status_time);
175-
#endif
176169
}
177170

178-
static void o2net_set_nst_sock_container(struct o2net_send_tracking *nst,
171+
void o2net_set_nst_sock_container(struct o2net_send_tracking *nst,
179172
struct o2net_sock_container *sc)
180173
{
181-
#ifdef CONFIG_DEBUG_FS
182174
nst->st_sc = sc;
183-
#endif
184175
}
185176

186-
static void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, u32 msg_id)
177+
void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, u32 msg_id)
187178
{
188-
#ifdef CONFIG_DEBUG_FS
189179
nst->st_id = msg_id;
190-
#endif
191180
}
181+
#endif /* CONFIG_DEBUG_FS */
192182

193183
static inline int o2net_reconnect_delay(void)
194184
{

fs/ocfs2/cluster/tcp.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,23 +128,23 @@ void o2net_debug_del_nst(struct o2net_send_tracking *nst);
128128
void o2net_debug_add_sc(struct o2net_sock_container *sc);
129129
void o2net_debug_del_sc(struct o2net_sock_container *sc);
130130
#else
131-
static int o2net_debugfs_init(void)
131+
static inline int o2net_debugfs_init(void)
132132
{
133133
return 0;
134134
}
135-
static void o2net_debugfs_exit(void)
135+
static inline void o2net_debugfs_exit(void)
136136
{
137137
}
138-
static void o2net_debug_add_nst(struct o2net_send_tracking *nst)
138+
static inline void o2net_debug_add_nst(struct o2net_send_tracking *nst)
139139
{
140140
}
141-
static void o2net_debug_del_nst(struct o2net_send_tracking *nst)
141+
static inline void o2net_debug_del_nst(struct o2net_send_tracking *nst)
142142
{
143143
}
144-
static void o2net_debug_add_sc(struct o2net_sock_container *sc)
144+
static inline void o2net_debug_add_sc(struct o2net_sock_container *sc)
145145
{
146146
}
147-
static void o2net_debug_del_sc(struct o2net_sock_container *sc)
147+
static inline void o2net_debug_del_sc(struct o2net_sock_container *sc)
148148
{
149149
}
150150
#endif /* CONFIG_DEBUG_FS */

fs/ocfs2/cluster/tcp_internal.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,42 @@ struct o2net_send_tracking {
224224
struct timeval st_send_time;
225225
struct timeval st_status_time;
226226
};
227+
228+
void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype,
229+
u32 msgkey, struct task_struct *task, u8 node);
230+
void o2net_set_nst_sock_time(struct o2net_send_tracking *nst);
231+
void o2net_set_nst_send_time(struct o2net_send_tracking *nst);
232+
void o2net_set_nst_status_time(struct o2net_send_tracking *nst);
233+
void o2net_set_nst_sock_container(struct o2net_send_tracking *nst,
234+
struct o2net_sock_container *sc);
235+
void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, u32 msg_id);
236+
227237
#else
228238
struct o2net_send_tracking {
229239
u32 dummy;
230240
};
241+
242+
static inline void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype,
243+
u32 msgkey, struct task_struct *task, u8 node)
244+
{
245+
}
246+
static inline void o2net_set_nst_sock_time(struct o2net_send_tracking *nst)
247+
{
248+
}
249+
static inline void o2net_set_nst_send_time(struct o2net_send_tracking *nst)
250+
{
251+
}
252+
static inline void o2net_set_nst_status_time(struct o2net_send_tracking *nst)
253+
{
254+
}
255+
static inline void o2net_set_nst_sock_container(struct o2net_send_tracking *nst,
256+
struct o2net_sock_container *sc)
257+
{
258+
}
259+
static inline void o2net_set_nst_msg_id(struct o2net_send_tracking *nst,
260+
u32 msg_id)
261+
{
262+
}
231263
#endif /* CONFIG_DEBUG_FS */
232264

233265
#endif /* O2CLUSTER_TCP_INTERNAL_H */

fs/ocfs2/dlm/dlmdebug.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,25 @@ void dlm_destroy_debugfs_root(void);
6060

6161
#else
6262

63-
static int dlm_debug_init(struct dlm_ctxt *dlm)
63+
static inline int dlm_debug_init(struct dlm_ctxt *dlm)
6464
{
6565
return 0;
6666
}
67-
static void dlm_debug_shutdown(struct dlm_ctxt *dlm)
67+
static inline void dlm_debug_shutdown(struct dlm_ctxt *dlm)
6868
{
6969
}
70-
static int dlm_create_debugfs_subroot(struct dlm_ctxt *dlm)
70+
static inline int dlm_create_debugfs_subroot(struct dlm_ctxt *dlm)
7171
{
7272
return 0;
7373
}
74-
static void dlm_destroy_debugfs_subroot(struct dlm_ctxt *dlm)
74+
static inline void dlm_destroy_debugfs_subroot(struct dlm_ctxt *dlm)
7575
{
7676
}
77-
static int dlm_create_debugfs_root(void)
77+
static inline int dlm_create_debugfs_root(void)
7878
{
7979
return 0;
8080
}
81-
static void dlm_destroy_debugfs_root(void)
81+
static inline void dlm_destroy_debugfs_root(void)
8282
{
8383
}
8484

fs/ocfs2/stack_user.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
* negotiated by the client. The client negotiates based on the maximum
6262
* version advertised in /sys/fs/ocfs2/max_locking_protocol. The major
6363
* number from the "SETV" message must match
64-
* user_stack.sp_proto->lp_max_version.pv_major, and the minor number
64+
* ocfs2_user_plugin.sp_proto->lp_max_version.pv_major, and the minor number
6565
* must be less than or equal to ...->lp_max_version.pv_minor.
6666
*
6767
* Once this information has been set, mounts will be allowed. From this
@@ -153,7 +153,7 @@ union ocfs2_control_message {
153153
struct ocfs2_control_message_down u_down;
154154
};
155155

156-
static struct ocfs2_stack_plugin user_stack;
156+
static struct ocfs2_stack_plugin ocfs2_user_plugin;
157157

158158
static atomic_t ocfs2_control_opened;
159159
static int ocfs2_control_this_node = -1;
@@ -399,7 +399,7 @@ static int ocfs2_control_do_setversion_msg(struct file *file,
399399
char *ptr = NULL;
400400
struct ocfs2_control_private *p = file->private_data;
401401
struct ocfs2_protocol_version *max =
402-
&user_stack.sp_proto->lp_max_version;
402+
&ocfs2_user_plugin.sp_proto->lp_max_version;
403403

404404
if (ocfs2_control_get_handshake_state(file) !=
405405
OCFS2_CONTROL_HANDSHAKE_PROTOCOL)
@@ -680,7 +680,7 @@ static void fsdlm_lock_ast_wrapper(void *astarg)
680680
struct dlm_lksb *lksb = fsdlm_astarg_to_lksb(astarg);
681681
int status = lksb->sb_status;
682682

683-
BUG_ON(user_stack.sp_proto == NULL);
683+
BUG_ON(ocfs2_user_plugin.sp_proto == NULL);
684684

685685
/*
686686
* For now we're punting on the issue of other non-standard errors
@@ -693,16 +693,16 @@ static void fsdlm_lock_ast_wrapper(void *astarg)
693693
*/
694694

695695
if (status == -DLM_EUNLOCK || status == -DLM_ECANCEL)
696-
user_stack.sp_proto->lp_unlock_ast(astarg, 0);
696+
ocfs2_user_plugin.sp_proto->lp_unlock_ast(astarg, 0);
697697
else
698-
user_stack.sp_proto->lp_lock_ast(astarg);
698+
ocfs2_user_plugin.sp_proto->lp_lock_ast(astarg);
699699
}
700700

701701
static void fsdlm_blocking_ast_wrapper(void *astarg, int level)
702702
{
703-
BUG_ON(user_stack.sp_proto == NULL);
703+
BUG_ON(ocfs2_user_plugin.sp_proto == NULL);
704704

705-
user_stack.sp_proto->lp_blocking_ast(astarg, level);
705+
ocfs2_user_plugin.sp_proto->lp_blocking_ast(astarg, level);
706706
}
707707

708708
static int user_dlm_lock(struct ocfs2_cluster_connection *conn,
@@ -838,7 +838,7 @@ static int user_cluster_this_node(unsigned int *this_node)
838838
return 0;
839839
}
840840

841-
static struct ocfs2_stack_operations user_stack_ops = {
841+
static struct ocfs2_stack_operations ocfs2_user_plugin_ops = {
842842
.connect = user_cluster_connect,
843843
.disconnect = user_cluster_disconnect,
844844
.this_node = user_cluster_this_node,
@@ -849,35 +849,35 @@ static struct ocfs2_stack_operations user_stack_ops = {
849849
.dump_lksb = user_dlm_dump_lksb,
850850
};
851851

852-
static struct ocfs2_stack_plugin user_stack = {
852+
static struct ocfs2_stack_plugin ocfs2_user_plugin = {
853853
.sp_name = "user",
854-
.sp_ops = &user_stack_ops,
854+
.sp_ops = &ocfs2_user_plugin_ops,
855855
.sp_owner = THIS_MODULE,
856856
};
857857

858858

859-
static int __init user_stack_init(void)
859+
static int __init ocfs2_user_plugin_init(void)
860860
{
861861
int rc;
862862

863863
rc = ocfs2_control_init();
864864
if (!rc) {
865-
rc = ocfs2_stack_glue_register(&user_stack);
865+
rc = ocfs2_stack_glue_register(&ocfs2_user_plugin);
866866
if (rc)
867867
ocfs2_control_exit();
868868
}
869869

870870
return rc;
871871
}
872872

873-
static void __exit user_stack_exit(void)
873+
static void __exit ocfs2_user_plugin_exit(void)
874874
{
875-
ocfs2_stack_glue_unregister(&user_stack);
875+
ocfs2_stack_glue_unregister(&ocfs2_user_plugin);
876876
ocfs2_control_exit();
877877
}
878878

879879
MODULE_AUTHOR("Oracle");
880880
MODULE_DESCRIPTION("ocfs2 driver for userspace cluster stacks");
881881
MODULE_LICENSE("GPL");
882-
module_init(user_stack_init);
883-
module_exit(user_stack_exit);
882+
module_init(ocfs2_user_plugin_init);
883+
module_exit(ocfs2_user_plugin_exit);

0 commit comments

Comments
 (0)