]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ns: add to_<type>_ns() to respective headers
authorChristian Brauner <brauner@kernel.org>
Fri, 12 Sep 2025 11:52:49 +0000 (13:52 +0200)
committerChristian Brauner <brauner@kernel.org>
Fri, 19 Sep 2025 12:26:16 +0000 (14:26 +0200)
commitd7afdf889561058068ab46fd8f306c70ef29216a
tree5391569ec3779f9f7f6b5f1a246d41dddc013b4b
parent58f976d41fd915acd2403a2b8e0eef8e9c478357
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>
14 files changed:
include/linux/cgroup.h
include/linux/ipc_namespace.h
include/linux/pid_namespace.h
include/linux/time_namespace.h
include/linux/user_namespace.h
include/linux/utsname.h
include/net/net_namespace.h
ipc/namespace.c
kernel/cgroup/namespace.c
kernel/pid_namespace.c
kernel/time/namespace.c
kernel/user_namespace.c
kernel/utsname.c
net/core/net_namespace.c