summaryrefslogtreecommitdiff
path: root/kernel/time
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@openvz.org>2019-11-12 01:26:53 +0000
committerThomas Gleixner <tglx@linutronix.de>2020-01-14 12:20:49 +0100
commitaf993f58d69ee9c1f421dfc87c3ed231c113989c (patch)
treec482a7253674ae00aad86b3907661912efc7a897 /kernel/time
parent769071ac9f20b6a447410c7eaa55d1a5233ef40c (diff)
time: Add timens_offsets to be used for tasks in time namespace
Introduce offsets for time namespace. They will contain an adjustment needed to convert clocks to/from host's. A new namespace is created with the same offsets as the time namespace of the current process. Co-developed-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Andrei Vagin <avagin@openvz.org> Signed-off-by: Dmitry Safonov <dima@arista.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20191112012724.250792-5-dima@arista.com
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/namespace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/time/namespace.c b/kernel/time/namespace.c
index 2662a69e0382..c2a58e45fc4b 100644
--- a/kernel/time/namespace.c
+++ b/kernel/time/namespace.c
@@ -14,6 +14,7 @@
#include <linux/slab.h>
#include <linux/cred.h>
#include <linux/err.h>
+#include <linux/mm.h>
static struct ucounts *inc_time_namespaces(struct user_namespace *ns)
{
@@ -60,6 +61,7 @@ static struct time_namespace *clone_time_ns(struct user_namespace *user_ns,
ns->ucounts = ucounts;
ns->ns.ops = &timens_operations;
ns->user_ns = get_user_ns(user_ns);
+ ns->offsets = old_ns->offsets;
return ns;
fail_free: