scst, latency statistics: Introduce timespec_to_ns().

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3879 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2011-09-24 14:11:39 +00:00
parent 24a453bc16
commit ee2dead009

View File

@@ -7488,8 +7488,13 @@ out_unlock:
static uint64_t scst_get_nsec(void)
{
struct timespec ts;
ktime_get_ts(&ts);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
return (uint64_t)ts.tv_sec * 1000000000 + ts.tv_nsec;
#else
return timespec_to_ns(&ts);
#endif
}
void scst_set_start_time(struct scst_cmd *cmd)