提交 64ce4c2f 编写于 作者: J John Stultz 提交者: Thomas Gleixner

time: Clean up warp_clock()

warp_clock() currently accesses timekeeping internal state directly, which
is unnecessary.  Convert it to use the proper timekeeping interfaces.
Signed-off-by: NJohn Stultz <johnstul@us.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
上级 c2873937
...@@ -133,12 +133,11 @@ SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv, ...@@ -133,12 +133,11 @@ SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv,
*/ */
static inline void warp_clock(void) static inline void warp_clock(void)
{ {
write_seqlock_irq(&xtime_lock); struct timespec delta, adjust;
wall_to_monotonic.tv_sec -= sys_tz.tz_minuteswest * 60; delta.tv_sec = sys_tz.tz_minuteswest * 60;
xtime.tv_sec += sys_tz.tz_minuteswest * 60; delta.tv_nsec = 0;
update_xtime_cache(0); adjust = timespec_add_safe(current_kernel_time(), delta);
write_sequnlock_irq(&xtime_lock); do_settimeofday(&adjust);
clock_was_set();
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册