summaryrefslogtreecommitdiff
path: root/fs/namespace.c
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-09-17 12:28:07 +0200
committerChristian Brauner <brauner@kernel.org>2025-09-19 14:26:19 +0200
commit5612ff3ec588be09f11a9424db6d1186bcdeb3fa (patch)
tree9dd354500d819171d059cb5045762a4753ab34b8 /fs/namespace.c
parentd5b27cb8c5f30c972e041b30bc38fa5875b1a469 (diff)
nscommon: simplify initialization
There's a lot of information that namespace implementers don't need to know about at all. Encapsulate this all in the initialization helper. Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/namespace.c')
-rw-r--r--fs/namespace.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index b2fcb901ad8c..699b8c770c47 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -4104,8 +4104,9 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns, bool a
}
if (anon)
- new_ns->ns.inum = MNT_NS_ANON_INO;
- ret = ns_common_init(&new_ns->ns, &mntns_operations, !anon);
+ ret = ns_common_init_inum(new_ns, &mntns_operations, MNT_NS_ANON_INO);
+ else
+ ret = ns_common_init(new_ns, &mntns_operations);
if (ret) {
kfree(new_ns);
dec_mnt_namespaces(ucounts);