aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/cluster
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/cluster')
-rw-r--r--fs/ocfs2/cluster/tcp.c28
-rw-r--r--fs/ocfs2/cluster/tcp.h12
-rw-r--r--fs/ocfs2/cluster/tcp_internal.h32
3 files changed, 47 insertions, 25 deletions
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index 1e44ad14881a..a27d61581bd6 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -142,53 +142,43 @@ static void o2net_idle_timer(unsigned long data);
142static void o2net_sc_postpone_idle(struct o2net_sock_container *sc); 142static void o2net_sc_postpone_idle(struct o2net_sock_container *sc);
143static void o2net_sc_reset_idle_timer(struct o2net_sock_container *sc); 143static void o2net_sc_reset_idle_timer(struct o2net_sock_container *sc);
144 144
145static void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype,
146 u32 msgkey, struct task_struct *task, u8 node)
147{
148#ifdef CONFIG_DEBUG_FS 145#ifdef CONFIG_DEBUG_FS
146void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype,
147 u32 msgkey, struct task_struct *task, u8 node)
148{
149 INIT_LIST_HEAD(&nst->st_net_debug_item); 149 INIT_LIST_HEAD(&nst->st_net_debug_item);
150 nst->st_task = task; 150 nst->st_task = task;
151 nst->st_msg_type = msgtype; 151 nst->st_msg_type = msgtype;
152 nst->st_msg_key = msgkey; 152 nst->st_msg_key = msgkey;
153 nst->st_node = node; 153 nst->st_node = node;
154#endif
155} 154}
156 155
157static void o2net_set_nst_sock_time(struct o2net_send_tracking *nst) 156void o2net_set_nst_sock_time(struct o2net_send_tracking *nst)
158{ 157{
159#ifdef CONFIG_DEBUG_FS
160 do_gettimeofday(&nst->st_sock_time); 158 do_gettimeofday(&nst->st_sock_time);
161#endif
162} 159}
163 160
164static void o2net_set_nst_send_time(struct o2net_send_tracking *nst) 161void o2net_set_nst_send_time(struct o2net_send_tracking *nst)
165{ 162{
166#ifdef CONFIG_DEBUG_FS
167 do_gettimeofday(&nst->st_send_time); 163 do_gettimeofday(&nst->st_send_time);
168#endif
169} 164}
170 165
171static void o2net_set_nst_status_time(struct o2net_send_tracking *nst) 166void o2net_set_nst_status_time(struct o2net_send_tracking *nst)
172{ 167{
173#ifdef CONFIG_DEBUG_FS
174 do_gettimeofday(&nst->st_status_time); 168 do_gettimeofday(&nst->st_status_time);
175#endif
176} 169}
177 170
178static void o2net_set_nst_sock_container(struct o2net_send_tracking *nst, 171void o2net_set_nst_sock_container(struct o2net_send_tracking *nst,
179 struct o2net_sock_container *sc) 172 struct o2net_sock_container *sc)
180{ 173{
181#ifdef CONFIG_DEBUG_FS
182 nst->st_sc = sc; 174 nst->st_sc = sc;
183#endif
184} 175}
185 176
186static void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, u32 msg_id) 177void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, u32 msg_id)
187{ 178{
188#ifdef CONFIG_DEBUG_FS
189 nst->st_id = msg_id; 179 nst->st_id = msg_id;
190#endif
191} 180}
181#endif /* CONFIG_DEBUG_FS */
192 182
193static inline int o2net_reconnect_delay(void) 183static inline int o2net_reconnect_delay(void)
194{ 184{
diff --git a/fs/ocfs2/cluster/tcp.h b/fs/ocfs2/cluster/tcp.h
index a705d5d19036..fd6179eb26d4 100644
--- a/fs/ocfs2/cluster/tcp.h
+++ b/fs/ocfs2/cluster/tcp.h
@@ -128,23 +128,23 @@ void o2net_debug_del_nst(struct o2net_send_tracking *nst);
128void o2net_debug_add_sc(struct o2net_sock_container *sc); 128void o2net_debug_add_sc(struct o2net_sock_container *sc);
129void o2net_debug_del_sc(struct o2net_sock_container *sc); 129void o2net_debug_del_sc(struct o2net_sock_container *sc);
130#else 130#else
131static int o2net_debugfs_init(void) 131static inline int o2net_debugfs_init(void)
132{ 132{
133 return 0; 133 return 0;
134} 134}
135static void o2net_debugfs_exit(void) 135static inline void o2net_debugfs_exit(void)
136{ 136{
137} 137}
138static void o2net_debug_add_nst(struct o2net_send_tracking *nst) 138static inline void o2net_debug_add_nst(struct o2net_send_tracking *nst)
139{ 139{
140} 140}
141static void o2net_debug_del_nst(struct o2net_send_tracking *nst) 141static inline void o2net_debug_del_nst(struct o2net_send_tracking *nst)
142{ 142{
143} 143}
144static void o2net_debug_add_sc(struct o2net_sock_container *sc) 144static inline void o2net_debug_add_sc(struct o2net_sock_container *sc)
145{ 145{
146} 146}
147static void o2net_debug_del_sc(struct o2net_sock_container *sc) 147static inline void o2net_debug_del_sc(struct o2net_sock_container *sc)
148{ 148{
149} 149}
150#endif /* CONFIG_DEBUG_FS */ 150#endif /* CONFIG_DEBUG_FS */
diff --git a/fs/ocfs2/cluster/tcp_internal.h b/fs/ocfs2/cluster/tcp_internal.h
index 8d58cfe410b1..18307ff81b77 100644
--- a/fs/ocfs2/cluster/tcp_internal.h
+++ b/fs/ocfs2/cluster/tcp_internal.h
@@ -224,10 +224,42 @@ struct o2net_send_tracking {
224 struct timeval st_send_time; 224 struct timeval st_send_time;
225 struct timeval st_status_time; 225 struct timeval st_status_time;
226}; 226};
227
228void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype,
229 u32 msgkey, struct task_struct *task, u8 node);
230void o2net_set_nst_sock_time(struct o2net_send_tracking *nst);
231void o2net_set_nst_send_time(struct o2net_send_tracking *nst);
232void o2net_set_nst_status_time(struct o2net_send_tracking *nst);
233void o2net_set_nst_sock_container(struct o2net_send_tracking *nst,
234 struct o2net_sock_container *sc);
235void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, u32 msg_id);
236
227#else 237#else
228struct o2net_send_tracking { 238struct o2net_send_tracking {
229 u32 dummy; 239 u32 dummy;
230}; 240};
241
242static inline void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype,
243 u32 msgkey, struct task_struct *task, u8 node)
244{
245}
246static inline void o2net_set_nst_sock_time(struct o2net_send_tracking *nst)
247{
248}
249static inline void o2net_set_nst_send_time(struct o2net_send_tracking *nst)
250{
251}
252static inline void o2net_set_nst_status_time(struct o2net_send_tracking *nst)
253{
254}
255static inline void o2net_set_nst_sock_container(struct o2net_send_tracking *nst,
256 struct o2net_sock_container *sc)
257{
258}
259static inline void o2net_set_nst_msg_id(struct o2net_send_tracking *nst,
260 u32 msg_id)
261{
262}
231#endif /* CONFIG_DEBUG_FS */ 263#endif /* CONFIG_DEBUG_FS */
232 264
233#endif /* O2CLUSTER_TCP_INTERNAL_H */ 265#endif /* O2CLUSTER_TCP_INTERNAL_H */