Thread (78 messages) 78 messages, 12 authors, 2025-10-24
STALE242d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 11/32] time: use ns_common_init()

From: Christian Brauner <brauner@kernel.org>
Date: 2025-09-10 14:38:11
Also in: cgroups, linux-block, linux-fsdevel, linux-kselftest, linux-nfs, lkml
Subsystem: posix clocks and timers, the rest · Maintainers: Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner, Linus Torvalds

Don't cargo-cult the same thing over and over.

Signed-off-by: Christian Brauner <brauner@kernel.org>
---
 kernel/time/namespace.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/kernel/time/namespace.c b/kernel/time/namespace.c
index 667452768ed3..80b3d2ce2fb6 100644
--- a/kernel/time/namespace.c
+++ b/kernel/time/namespace.c
@@ -92,18 +92,15 @@ static struct time_namespace *clone_time_ns(struct user_namespace *user_ns,
 	if (!ns)
 		goto fail_dec;
 
-	refcount_set(&ns->ns.count, 1);
-
 	ns->vvar_page = alloc_page(GFP_KERNEL_ACCOUNT | __GFP_ZERO);
 	if (!ns->vvar_page)
 		goto fail_free;
 
-	err = ns_alloc_inum(&ns->ns);
+	err = ns_common_init(&ns->ns, &timens_operations, true);
 	if (err)
 		goto fail_free_page;
 
 	ns->ucounts = ucounts;
-	ns->ns.ops = &timens_operations;
 	ns->user_ns = get_user_ns(user_ns);
 	ns->offsets = old_ns->offsets;
 	ns->frozen_offsets = false;
-- 
2.47.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help