summaryrefslogtreecommitdiff
path: root/net/core/net_namespace.c
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-09-22 14:42:36 +0200
committerChristian Brauner <brauner@kernel.org>2025-09-22 14:47:10 +0200
commitd7610cb7454bbd8bf6d58f71b0ed57155d3c545f (patch)
tree4014182d87c6fd373cabe9239b7766cd951e1964 /net/core/net_namespace.c
parent8535bd38b4d58a3d19bf8e7dfa66e1d8180b316a (diff)
ns: simplify ns_common_init() further
Simply derive the ns operations from the namespace type. Acked-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'net/core/net_namespace.c')
-rw-r--r--net/core/net_namespace.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index d5e3fd819163..bdea7d5fac56 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -400,16 +400,9 @@ static __net_init void preinit_net_sysctl(struct net *net)
/* init code that must occur even if setup_net() is not called. */
static __net_init int preinit_net(struct net *net, struct user_namespace *user_ns)
{
- const struct proc_ns_operations *ns_ops;
int ret;
-#ifdef CONFIG_NET_NS
- ns_ops = &netns_operations;
-#else
- ns_ops = NULL;
-#endif
-
- ret = ns_common_init(net, ns_ops);
+ ret = ns_common_init(net);
if (ret)
return ret;