Skip to content

Commit 0f475b2

Browse files
Sunil MushranMark Fasheh
authored andcommitted
[PATCH 3/3] ocfs2/net: Silence build warnings
This patch silences the build warnings concerning o2net_init_nst() and friends when building without CONFIG_DEBUG_FS enabled. Signed-off-by: Sunil Mushran <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
1 parent 959040c commit 0f475b2

File tree

2 files changed

+41
-19
lines changed

2 files changed

+41
-19
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_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 */

0 commit comments

Comments
 (0)