]> granicus.if.org Git - spl/commitdiff
Use do_posix_clock_monotonic_gettime() as described by comment.
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 14 May 2010 16:31:22 +0000 (09:31 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 14 May 2010 16:31:22 +0000 (09:31 -0700)
While this does incur slightly more overhead we should be using
do_posix_clock_monotonic_gettime() for gethrtime() as described
by the existing comment.

module/spl/spl-time.c

index 2973ae82d58c4428d2d81d928dff908e73377072..6806dcf71fe5450da8cc4f743e7709374c795a63 100644 (file)
@@ -60,9 +60,10 @@ __gethrtime(void) {
         /* Deal with signed/unsigned mismatch */
         return (hrtime_t)(res & ~(1ULL << 63));
 #else
-        uint64_t j = get_jiffies_64();
+        struct timespec ts;
 
-        return (hrtime_t)(j * (NSEC_PER_SEC / HZ));
+        do_posix_clock_monotonic_gettime(&ts);
+        return (hrtime_t)((ts.tv_sec * NSEC_PER_SEC) + ts.tv_nsec);
 #endif
 }
 EXPORT_SYMBOL(__gethrtime);