diff options
author | Sunil Mushran <sunil.mushran@oracle.com> | 2010-12-22 15:39:38 -0500 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-12-22 21:34:49 -0500 |
commit | 3f9c14fab0a2e90af9995f261a123f59e0b41141 (patch) | |
tree | 69a2a6a07d4c2144c06acd81cd2ff32b62879253 /fs/ocfs2/cluster | |
parent | 8757241e32a295a2aa836e8f8b32912204d11fda (diff) |
ocfs2/cluster: Replace timeval with ktime in struct o2net_send_tracking
Replace time trackers in struct o2net_send_tracking from struct timeval to
union ktime.
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/cluster')
-rw-r--r-- | fs/ocfs2/cluster/netdebug.c | 22 | ||||
-rw-r--r-- | fs/ocfs2/cluster/tcp.c | 6 | ||||
-rw-r--r-- | fs/ocfs2/cluster/tcp_internal.h | 6 |
3 files changed, 19 insertions, 15 deletions
diff --git a/fs/ocfs2/cluster/netdebug.c b/fs/ocfs2/cluster/netdebug.c index 0edf836b42d5..2b986aa82299 100644 --- a/fs/ocfs2/cluster/netdebug.c +++ b/fs/ocfs2/cluster/netdebug.c | |||
@@ -123,10 +123,17 @@ static void *nst_seq_next(struct seq_file *seq, void *v, loff_t *pos) | |||
123 | static int nst_seq_show(struct seq_file *seq, void *v) | 123 | static int nst_seq_show(struct seq_file *seq, void *v) |
124 | { | 124 | { |
125 | struct o2net_send_tracking *nst, *dummy_nst = seq->private; | 125 | struct o2net_send_tracking *nst, *dummy_nst = seq->private; |
126 | ktime_t now; | ||
127 | s64 sock, send, status; | ||
126 | 128 | ||
127 | spin_lock(&o2net_debug_lock); | 129 | spin_lock(&o2net_debug_lock); |
128 | nst = next_nst(dummy_nst); | 130 | nst = next_nst(dummy_nst); |
129 | 131 | ||
132 | now = ktime_get(); | ||
133 | sock = ktime_to_us(ktime_sub(now, nst->st_sock_time)); | ||
134 | send = ktime_to_us(ktime_sub(now, nst->st_send_time)); | ||
135 | status = ktime_to_us(ktime_sub(now, nst->st_status_time)); | ||
136 | |||
130 | if (nst != NULL) { | 137 | if (nst != NULL) { |
131 | /* get_task_comm isn't exported. oh well. */ | 138 | /* get_task_comm isn't exported. oh well. */ |
132 | seq_printf(seq, "%p:\n" | 139 | seq_printf(seq, "%p:\n" |
@@ -138,20 +145,17 @@ static int nst_seq_show(struct seq_file *seq, void *v) | |||
138 | " message id: %d\n" | 145 | " message id: %d\n" |
139 | " message type: %u\n" | 146 | " message type: %u\n" |
140 | " message key: 0x%08x\n" | 147 | " message key: 0x%08x\n" |
141 | " sock acquiry: %lu.%ld\n" | 148 | " sock acquiry: %lld usecs ago\n" |
142 | " send start: %lu.%ld\n" | 149 | " send start: %lld usecs ago\n" |
143 | " wait start: %lu.%ld\n", | 150 | " wait start: %lld usecs ago\n", |
144 | nst, (unsigned long)task_pid_nr(nst->st_task), | 151 | nst, (unsigned long)task_pid_nr(nst->st_task), |
145 | (unsigned long)nst->st_task->tgid, | 152 | (unsigned long)nst->st_task->tgid, |
146 | nst->st_task->comm, nst->st_node, | 153 | nst->st_task->comm, nst->st_node, |
147 | nst->st_sc, nst->st_id, nst->st_msg_type, | 154 | nst->st_sc, nst->st_id, nst->st_msg_type, |
148 | nst->st_msg_key, | 155 | nst->st_msg_key, |
149 | nst->st_sock_time.tv_sec, | 156 | (long long)sock, |
150 | (long)nst->st_sock_time.tv_usec, | 157 | (long long)send, |
151 | nst->st_send_time.tv_sec, | 158 | (long long)status); |
152 | (long)nst->st_send_time.tv_usec, | ||
153 | nst->st_status_time.tv_sec, | ||
154 | (long)nst->st_status_time.tv_usec); | ||
155 | } | 159 | } |
156 | 160 | ||
157 | spin_unlock(&o2net_debug_lock); | 161 | spin_unlock(&o2net_debug_lock); |
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index 92de96cd247d..49c1a95e352e 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c | |||
@@ -155,17 +155,17 @@ static void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype, | |||
155 | 155 | ||
156 | static void o2net_set_nst_sock_time(struct o2net_send_tracking *nst) | 156 | static void o2net_set_nst_sock_time(struct o2net_send_tracking *nst) |
157 | { | 157 | { |
158 | do_gettimeofday(&nst->st_sock_time); | 158 | nst->st_sock_time = ktime_get(); |
159 | } | 159 | } |
160 | 160 | ||
161 | static void o2net_set_nst_send_time(struct o2net_send_tracking *nst) | 161 | static void o2net_set_nst_send_time(struct o2net_send_tracking *nst) |
162 | { | 162 | { |
163 | do_gettimeofday(&nst->st_send_time); | 163 | nst->st_send_time = ktime_get(); |
164 | } | 164 | } |
165 | 165 | ||
166 | static void o2net_set_nst_status_time(struct o2net_send_tracking *nst) | 166 | static void o2net_set_nst_status_time(struct o2net_send_tracking *nst) |
167 | { | 167 | { |
168 | do_gettimeofday(&nst->st_status_time); | 168 | nst->st_status_time = ktime_get(); |
169 | } | 169 | } |
170 | 170 | ||
171 | static void o2net_set_nst_sock_container(struct o2net_send_tracking *nst, | 171 | static void o2net_set_nst_sock_container(struct o2net_send_tracking *nst, |
diff --git a/fs/ocfs2/cluster/tcp_internal.h b/fs/ocfs2/cluster/tcp_internal.h index 15fdbdf9eb4b..b613aaaf3e5c 100644 --- a/fs/ocfs2/cluster/tcp_internal.h +++ b/fs/ocfs2/cluster/tcp_internal.h | |||
@@ -220,9 +220,9 @@ struct o2net_send_tracking { | |||
220 | u32 st_msg_type; | 220 | u32 st_msg_type; |
221 | u32 st_msg_key; | 221 | u32 st_msg_key; |
222 | u8 st_node; | 222 | u8 st_node; |
223 | struct timeval st_sock_time; | 223 | ktime_t st_sock_time; |
224 | struct timeval st_send_time; | 224 | ktime_t st_send_time; |
225 | struct timeval st_status_time; | 225 | ktime_t st_status_time; |
226 | }; | 226 | }; |
227 | #else | 227 | #else |
228 | struct o2net_send_tracking { | 228 | struct o2net_send_tracking { |