Thread (60 messages) read the whole thread 60 messages, 7 authors, 2019-10-24

[PATCHv7 16/33] fs/proc: Respect boottime inside time namespace for /proc/uptime

From: Dmitry Safonov <hidden>
Date: 2019-10-11 01:24:16
Also in: lkml
Subsystem: filesystems (vfs and infrastructure), proc filesystem, the rest · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds

Co-developed-by: Andrei Vagin <redacted>
Signed-off-by: Andrei Vagin <redacted>
Signed-off-by: Dmitry Safonov <redacted>
---
 fs/proc/uptime.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/fs/proc/uptime.c b/fs/proc/uptime.c
index a4c2791ab70b..5a1b228964fb 100644
--- a/fs/proc/uptime.c
+++ b/fs/proc/uptime.c
@@ -5,6 +5,7 @@
 #include <linux/sched.h>
 #include <linux/seq_file.h>
 #include <linux/time.h>
+#include <linux/time_namespace.h>
 #include <linux/kernel_stat.h>
 
 static int uptime_proc_show(struct seq_file *m, void *v)
@@ -20,6 +21,8 @@ static int uptime_proc_show(struct seq_file *m, void *v)
 		nsec += (__force u64) kcpustat_cpu(i).cpustat[CPUTIME_IDLE];
 
 	ktime_get_boottime_ts64(&uptime);
+	timens_add_boottime(&uptime);
+
 	idle.tv_sec = div_u64_rem(nsec, NSEC_PER_SEC, &rem);
 	idle.tv_nsec = rem;
 	seq_printf(m, "%lu.%02lu %lu.%02lu\n",
-- 
2.23.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help