ns: add ns_common_free()

And drop ns_free_inum(). Anything common that can be wasted centrally
should be wasted in the new common helper.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Christian Brauner
2025-09-17 12:28:08 +02:00
parent 5612ff3ec5
commit be5f21d398
11 changed files with 21 additions and 15 deletions

View File

@@ -127,7 +127,7 @@ static struct pid_namespace *create_pid_namespace(struct user_namespace *user_ns
return ns;
out_free_inum:
ns_free_inum(&ns->ns);
ns_common_free(ns);
out_free_idr:
idr_destroy(&ns->idr);
kmem_cache_free(pid_ns_cachep, ns);
@@ -152,7 +152,7 @@ static void destroy_pid_namespace(struct pid_namespace *ns)
ns_tree_remove(ns);
unregister_pidns_sysctls(ns);
ns_free_inum(&ns->ns);
ns_common_free(ns);
idr_destroy(&ns->idr);
call_rcu(&ns->rcu, delayed_free_pidns);