futex: Move drop_futex_key_refs out of spinlock'ed region
[safe/jmp/linux-2.6] / kernel / time / timekeeping.c
index 15e06de..fb0f46f 100644 (file)
@@ -826,9 +826,11 @@ void update_wall_time(void)
  */
 void getboottime(struct timespec *ts)
 {
-       struct timespec boottime;
+       struct timespec boottime = {
+               .tv_sec = wall_to_monotonic.tv_sec + total_sleep_time.tv_sec,
+               .tv_nsec = wall_to_monotonic.tv_nsec + total_sleep_time.tv_nsec
+       };
 
-       boottime = timespec_add_safe(wall_to_monotonic, total_sleep_time);
        set_normalized_timespec(ts, -boottime.tv_sec, -boottime.tv_nsec);
 }
 
@@ -847,6 +849,10 @@ unsigned long get_seconds(void)
 }
 EXPORT_SYMBOL(get_seconds);
 
+struct timespec __current_kernel_time(void)
+{
+       return xtime_cache;
+}
 
 struct timespec current_kernel_time(void)
 {
@@ -862,3 +868,20 @@ struct timespec current_kernel_time(void)
        return now;
 }
 EXPORT_SYMBOL(current_kernel_time);
+
+struct timespec get_monotonic_coarse(void)
+{
+       struct timespec now, mono;
+       unsigned long seq;
+
+       do {
+               seq = read_seqbegin(&xtime_lock);
+
+               now = xtime_cache;
+               mono = wall_to_monotonic;
+       } while (read_seqretry(&xtime_lock, seq));
+
+       set_normalized_timespec(&now, now.tv_sec + mono.tv_sec,
+                               now.tv_nsec + mono.tv_nsec);
+       return now;
+}