aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-05-14 09:31:22 -0700
committerBrian Behlendorf <[email protected]>2010-05-14 09:31:22 -0700
commit6020190e8f5a94bee7e65a787a1b784cb0f4c4d0 (patch)
tree93e947a24c6fea126e5972bfc05ed965dc677de5 /module
parentf752b46eb3c3b889d62465ea800cf17c980becd1 (diff)
Use do_posix_clock_monotonic_gettime() as described by comment.
While this does incur slightly more overhead we should be using do_posix_clock_monotonic_gettime() for gethrtime() as described by the existing comment.
Diffstat (limited to 'module')
-rw-r--r--module/spl/spl-time.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/module/spl/spl-time.c b/module/spl/spl-time.c
index 2973ae82d..6806dcf71 100644
--- a/module/spl/spl-time.c
+++ b/module/spl/spl-time.c
@@ -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);