Modify gethrestime to use current_kernel_time()

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
This commit is contained in:
James H 2013-07-13 21:25:04 +01:00 committed by Brian Behlendorf
parent f7f344f1b0
commit c47efbc7fd
1 changed files with 3 additions and 4 deletions

View 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);