From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752968AbbKJL7y (ORCPT ); Tue, 10 Nov 2015 06:59:54 -0500 Received: from smtp.citrix.com ([66.165.176.63]:49331 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751838AbbKJL6O (ORCPT ); Tue, 10 Nov 2015 06:58:14 -0500 X-IronPort-AV: E=Sophos;i="5.20,270,1444694400"; d="scan'208";a="317031500" From: Stefano Stabellini To: CC: , , , , Stefano Stabellini , , , , , Subject: [PATCH v2 1/7] timekeeping: introduce __current_kernel_time64 Date: Tue, 10 Nov 2015 11:57:49 +0000 Message-ID: <1447156675-7418-1-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-DLP: MIA2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org __current_kernel_time64 returns a struct timespec64, without taking the xtime lock. Mirrors __current_kernel_time/current_kernel_time. Signed-off-by: Stefano Stabellini CC: arnd@arndb.de CC: john.stultz@linaro.org CC: tglx@linutronix.de CC: mingo@kernel.org CC: peterz@infradead.org --- include/linux/timekeeping.h | 3 ++- kernel/time/timekeeping.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index ec89d84..b5802bf 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h @@ -19,7 +19,8 @@ extern int do_sys_settimeofday(const struct timespec *tv, */ unsigned long get_seconds(void); struct timespec64 current_kernel_time64(void); -/* does not take xtime_lock */ +/* do not take xtime_lock */ +struct timespec64 __current_kernel_time64(void); struct timespec __current_kernel_time(void); static inline struct timespec current_kernel_time(void) diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index b1356b7..c1221c2 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -1881,6 +1881,13 @@ struct timespec __current_kernel_time(void) return timespec64_to_timespec(tk_xtime(tk)); } +struct timespec64 __current_kernel_time64(void) +{ + struct timekeeper *tk = &tk_core.timekeeper; + + return tk_xtime(tk); +} + struct timespec64 current_kernel_time64(void) { struct timekeeper *tk = &tk_core.timekeeper; -- 1.7.10.4