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:
parent
f7f344f1b0
commit
c47efbc7fd
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue