From: Guangyu Sun Date: Thu, 4 Oct 2012 22:46:58 +0000 (-0700) Subject: Revert "time: Move common updates to a function" X-Git-Tag: v2.6.39-400.9.0~303^2~18 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2f775a73c5376a6da3608bcd4b3fdf8919c47bf6;p=users%2Fjedix%2Flinux-maple.git Revert "time: Move common updates to a function" This reverts commit 20bb7a289f986cfda97d2dd5b9d035f32b9c103e. Signed-off-by: Guangyu Sun --- diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index d9efcdd37bfd6..4e6cd20a1683d 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -166,19 +166,6 @@ static struct timespec total_sleep_time; */ static struct timespec raw_time; -/* must hold write on xtime_lock */ -static void timekeeping_update(bool clearntp) -{ - if (clearntp) { - timekeeper.ntp_error = 0; - ntp_clear(); - } - update_vsyscall(&xtime, &wall_to_monotonic, - timekeeper.clock, timekeeper.mult); -} - - - /* flag for if timekeeping is suspended */ int __read_mostly timekeeping_suspended; @@ -388,7 +375,11 @@ int do_settimeofday(const struct timespec *tv) xtime = *tv; - timekeeping_update(true); + timekeeper.ntp_error = 0; + ntp_clear(); + + update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, + timekeeper.mult); write_sequnlock_irqrestore(&xtime_lock, flags); @@ -421,7 +412,11 @@ int timekeeping_inject_offset(struct timespec *ts) xtime = timespec_add(xtime, *ts); wall_to_monotonic = timespec_sub(wall_to_monotonic, *ts); - timekeeping_update(true); + timekeeper.ntp_error = 0; + ntp_clear(); + + update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, + timekeeper.mult); write_sequnlock_irqrestore(&xtime_lock, flags); @@ -644,7 +639,10 @@ void timekeeping_inject_sleeptime(struct timespec *delta) __timekeeping_inject_sleeptime(delta); - timekeeping_update(true); + timekeeper.ntp_error = 0; + ntp_clear(); + update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, + timekeeper.mult); write_sequnlock_irqrestore(&xtime_lock, flags); @@ -949,7 +947,9 @@ static void update_wall_time(void) wall_to_monotonic.tv_sec -= leap; } - timekeeping_update(false); + /* check to see if there is a new clocksource to use */ + update_vsyscall(&xtime, &wall_to_monotonic, timekeeper.clock, + timekeeper.mult); } /**