summaryrefslogtreecommitdiff
path: root/drivers/staging/lustre/lnet/selftest/framework.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2015-09-27 20:45:12 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-29 02:03:35 (GMT)
commit70513c5d17b9812cc218e8b4c7826ebb5f375d9a (patch)
tree097c22bafc25ed7f8f41b16166016fb3ac10267a /drivers/staging/lustre/lnet/selftest/framework.c
parente8453c24d7f610ec67cc1bbbcf5c8b6880645672 (diff)
downloadlinux-70513c5d17b9812cc218e8b4c7826ebb5f375d9a.tar.xz
staging/lustre: use jiffies_to_*() instead of cfs_duration_usec
The cfs_duration_usec() function has a timeval as its output, which we want to avoid in general because of the y2038 problem. There are only two locations remaining in lustre, so we can for now replace one with jiffies_to_timeval(), which is a generic kernel function that does the same thing, the other can just use jiffies_to_usecs() and completely avoid the timeval. This is not a full solution yet, but it's a small step that lets us build a larger portion of lustre without this reference to timeval in a header file, and avoid triggering automated checking tools that wants to warn about timeval. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lnet/selftest/framework.c')
-rw-r--r--drivers/staging/lustre/lnet/selftest/framework.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c
index 257de35..c448037 100644
--- a/drivers/staging/lustre/lnet/selftest/framework.c
+++ b/drivers/staging/lustre/lnet/selftest/framework.c
@@ -372,7 +372,6 @@ sfw_get_stats(srpc_stat_reqst_t *request, srpc_stat_reply_t *reply)
sfw_session_t *sn = sfw_data.fw_session;
sfw_counters_t *cnt = &reply->str_fw;
sfw_batch_t *bat;
- struct timeval tv;
reply->str_sid = (sn == NULL) ? LST_INVALID_SID : sn->sn_id;
@@ -391,10 +390,7 @@ sfw_get_stats(srpc_stat_reqst_t *request, srpc_stat_reply_t *reply)
/* send over the msecs since the session was started
- with 32 bits to send, this is ~49 days */
- cfs_duration_usec(cfs_time_sub(cfs_time_current(),
- sn->sn_started), &tv);
-
- cnt->running_ms = (__u32)(tv.tv_sec * 1000 + tv.tv_usec / 1000);
+ cnt->running_ms = jiffies_to_msecs(jiffies - sn->sn_started);
cnt->brw_errors = atomic_read(&sn->sn_brw_errors);
cnt->ping_errors = atomic_read(&sn->sn_ping_errors);
cnt->zombie_sessions = atomic_read(&sfw_data.fw_nzombies);