]> granicus.if.org Git - spl/commitdiff
Modify gethrestime to use current_kernel_time()
authorJames H <james@kagisoft.co.uk>
Sat, 13 Jul 2013 20:25:04 +0000 (21:25 +0100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 15 Jul 2013 16:17:19 +0000 (09:17 -0700)
This allows us to get nanosecond resolution. It also means
we use the same time source as utimensat(now) etc.

Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #255

module/spl/spl-time.c

index 8f43b54cd43cb0b4cb6f35e38c9bbc1b4339a0e9..20fd0e3e7eba7eeb420ff1bb2b35a73a9af20ec5 100644 (file)
@@ -40,11 +40,10 @@ extern unsigned long long monotonic_clock(void);
 void
 __gethrestime(timestruc_t *ts)
 {
-        struct timeval tv;
+       struct timespec tspec = current_kernel_time();
 
-       do_gettimeofday(&tv);
-       ts->tv_sec = tv.tv_sec;
-       ts->tv_nsec = tv.tv_usec * NSEC_PER_USEC;
+       ts->tv_sec = tspec.tv_sec;
+       ts->tv_nsec = tspec.tv_nsec;
 }
 EXPORT_SYMBOL(__gethrestime);