aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/time.h
diff options
context:
space:
mode:
authorjohn stultz <johnstul@us.ibm.com>2007-07-24 20:47:43 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-25 13:09:20 -0400
commit2c6b47de17c75d553de3e2fb426d8298d2074585 (patch)
treec8edc3d727d85cb3e1c043583c350a04a133e1a3 /include/linux/time.h
parent0de085bb474f64e4fdb2f1ff3268590792648c7b (diff)
Cleanup non-arch xtime uses, use get_seconds() or current_kernel_time().
This avoids use of the kernel-internal "xtime" variable directly outside of the actual time-related functions. Instead, use the helper functions that we already have available to us. This doesn't actually change any behaviour, but this will allow us to fix the fact that "xtime" isn't updated very often with CONFIG_NO_HZ (because much of the realtime information is maintained as separate offsets to 'xtime'), which has caused interfaces that use xtime directly to get a time that is out of sync with the real-time clock by up to a third of a second or so. Signed-off-by: John Stultz <johnstul@us.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/time.h')
-rw-r--r--include/linux/time.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/time.h b/include/linux/time.h
index e6aea5146e5d..71181df8b744 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -107,7 +107,7 @@ static inline unsigned long get_seconds(void)
107struct timespec current_kernel_time(void); 107struct timespec current_kernel_time(void);
108 108
109#define CURRENT_TIME (current_kernel_time()) 109#define CURRENT_TIME (current_kernel_time())
110#define CURRENT_TIME_SEC ((struct timespec) { xtime.tv_sec, 0 }) 110#define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 })
111 111
112extern void do_gettimeofday(struct timeval *tv); 112extern void do_gettimeofday(struct timeval *tv);
113extern int do_settimeofday(struct timespec *tv); 113extern int do_settimeofday(struct timespec *tv);