aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-09-12 13:52:49 +0200
committerChristian Brauner <brauner@kernel.org>2025-09-19 14:26:16 +0200
commitd7afdf889561058068ab46fd8f306c70ef29216a (patch)
tree5391569ec3779f9f7f6b5f1a246d41dddc013b4b /net/core
parentuts: support ns lookup (diff)
downloadlinux-d7afdf889561058068ab46fd8f306c70ef29216a.tar.gz
linux-d7afdf889561058068ab46fd8f306c70ef29216a.zip
ns: add to_<type>_ns() to respective headers
Every namespace type has a container_of(ns, <ns_type>, ns) static inline function that is currently not exposed in the header. So we have a bunch of places that open-code it via container_of(). Move it to the headers so we can use it directly. Reviewed-by: Aleksa Sarai <cyphar@cyphar.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/net_namespace.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 169ec22c4758..a57b3cda8dbc 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -1541,11 +1541,6 @@ static struct ns_common *netns_get(struct task_struct *task)
return net ? &net->ns : NULL;
}
-static inline struct net *to_net_ns(struct ns_common *ns)
-{
- return container_of(ns, struct net, ns);
-}
-
static void netns_put(struct ns_common *ns)
{
put_net(to_net_ns(ns));