From: Maoyi Xie <maoyixie.tju@gmail.com>
To: Thomas Gleixner <tglx@kernel.org>,
Anna-Maria Behnsen <anna-maria@linutronix.de>,
Frederic Weisbecker <frederic@kernel.org>,
Elizabeth Figura <zfigura@codeweavers.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Maoyi Xie <maoyixie.tju@gmail.com>
Subject: [PATCH 1/2] time/namespace: export init_time_ns and do_timens_ktime_to_host
Date: Thu, 28 May 2026 14:33:10 +0800 [thread overview]
Message-ID: <20260528063311.3300393-2-maoyixie.tju@gmail.com> (raw)
In-Reply-To: <20260528063311.3300393-1-maoyixie.tju@gmail.com>
The inline timens_ktime_to_host() in <linux/time_namespace.h> compares
the current time namespace against init_time_ns for the fast path. It
calls do_timens_ktime_to_host() for the offset case. Both symbols are
needed at link time by any caller of the inline.
All current callers are in the kernel itself (timerfd, posix-timers,
alarmtimer, posix-stubs, futex, io_uring). The next caller is a module
(ntsync), which fails to load because neither symbol is exported.
Export both with EXPORT_SYMBOL_GPL. The header already declares
init_time_ns extern, so this only makes the symbols linkable from
modules.
Signed-off-by: Maoyi Xie <maoyixie.tju@gmail.com>
---
kernel/time/namespace.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/time/namespace.c b/kernel/time/namespace.c
index 4bca3f78c8ea..5fa0af66cf3f 100644
--- a/kernel/time/namespace.c
+++ b/kernel/time/namespace.c
@@ -57,6 +57,7 @@ ktime_t do_timens_ktime_to_host(clockid_t clockid, ktime_t tim,
return tim;
}
+EXPORT_SYMBOL_GPL(do_timens_ktime_to_host);
static struct ucounts *inc_time_namespaces(struct user_namespace *ns)
{
@@ -351,6 +352,7 @@ struct time_namespace init_time_ns = {
.user_ns = &init_user_ns,
.frozen_offsets = true,
};
+EXPORT_SYMBOL_GPL(init_time_ns);
void __init time_ns_init(void)
{
--
2.34.1
next prev parent reply other threads:[~2026-05-28 6:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 6:33 [PATCH 0/2] ntsync: honour time namespace offset in absolute MONOTONIC timeouts Maoyi Xie
2026-05-28 6:33 ` Maoyi Xie [this message]
2026-06-02 19:08 ` [tip: timers/core] time/namespace: Export init_time_ns and do_timens_ktime_to_host() tip-bot2 for Maoyi Xie
2026-05-28 6:33 ` [PATCH 2/2] ntsync: honour caller's time namespace for absolute MONOTONIC timeouts Maoyi Xie
2026-06-01 22:12 ` Elizabeth Figura
2026-06-02 19:08 ` [tip: timers/core] ntsync: Honour " tip-bot2 for Maoyi Xie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260528063311.3300393-2-maoyixie.tju@gmail.com \
--to=maoyixie.tju@gmail.com \
--cc=anna-maria@linutronix.de \
--cc=arnd@arndb.de \
--cc=frederic@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@kernel.org \
--cc=zfigura@codeweavers.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®