aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stultz <johnstul@us.ibm.com>2010-03-11 17:04:47 -0500
committerThomas Gleixner <tglx@linutronix.de>2010-03-12 16:40:42 -0500
commit64ce4c2f5252f25798117fa80a027993163d6d84 (patch)
tree31aa86362e27a9a83958cf789ed31d4e674aa5ff
parentc28739375bf0d6e239b4fa939ec8372aa2c707d2 (diff)
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: John Stultz <johnstul@us.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--kernel/time.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/time.c b/kernel/time.c
index 804798005d19..2358a3646a63 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -133,12 +133,11 @@ SYSCALL_DEFINE2(gettimeofday, struct timeval __user *, tv,
133 */ 133 */
134static inline void warp_clock(void) 134static inline void warp_clock(void)
135{ 135{
136 write_seqlock_irq(&xtime_lock); 136 struct timespec delta, adjust;
137 wall_to_monotonic.tv_sec -= sys_tz.tz_minuteswest * 60; 137 delta.tv_sec = sys_tz.tz_minuteswest * 60;
138 xtime.tv_sec += sys_tz.tz_minuteswest * 60; 138 delta.tv_nsec = 0;
139 update_xtime_cache(0); 139 adjust = timespec_add_safe(current_kernel_time(), delta);
140 write_sequnlock_irq(&xtime_lock); 140 do_settimeofday(&adjust);
141 clock_was_set();
142} 141}
143 142
144/* 143/*