]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pid: use ns_common_init()
authorChristian Brauner <brauner@kernel.org>
Fri, 12 Sep 2025 11:52:35 +0000 (13:52 +0200)
committerChristian Brauner <brauner@kernel.org>
Fri, 19 Sep 2025 12:26:13 +0000 (14:26 +0200)
Don't cargo-cult the same thing over and over.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
kernel/pid_namespace.c

index 7098ed44e717d3da8f518f3826cb8047bb744786..20ce4052d1c51315c6047215ec46b1cd3b047d43 100644 (file)
@@ -102,17 +102,15 @@ static struct pid_namespace *create_pid_namespace(struct user_namespace *user_ns
        if (ns->pid_cachep == NULL)
                goto out_free_idr;
 
-       err = ns_alloc_inum(&ns->ns);
+       err = ns_common_init(&ns->ns, &pidns_operations, true);
        if (err)
                goto out_free_idr;
-       ns->ns.ops = &pidns_operations;
 
        ns->pid_max = PID_MAX_LIMIT;
        err = register_pidns_sysctls(ns);
        if (err)
                goto out_free_inum;
 
-       refcount_set(&ns->ns.count, 1);
        ns->level = level;
        ns->parent = get_pid_ns(parent_pid_ns);
        ns->user_ns = get_user_ns(user_ns);