From patchwork Tue Nov 10 11:57:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 7589911 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E0CC49F2F7 for ; Tue, 10 Nov 2015 12:01:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 15DEE20708 for ; Tue, 10 Nov 2015 12:01:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F3B0A20632 for ; Tue, 10 Nov 2015 12:01:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zw7aN-0006y2-TK; Tue, 10 Nov 2015 11:59:39 +0000 Received: from smtp02.citrix.com ([66.165.176.63]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zw7ZL-000632-C6 for linux-arm-kernel@lists.infradead.org; Tue, 10 Nov 2015 11:58:38 +0000 X-IronPort-AV: E=Sophos;i="5.20,270,1444694400"; d="scan'208";a="317031500" From: Stefano Stabellini To: 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 X-DLP: MIA2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151110_035835_796287_EDA2EE0F X-CRM114-Status: UNSURE ( 8.20 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -4.5 (----) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ian.Campbell@citrix.com, arnd@arndb.de, Stefano Stabellini , peterz@infradead.org, linux-kernel@vger.kernel.org, john.stultz@linaro.org, tglx@linutronix.de, mingo@kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP __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;