[PATCH 0/9] ns: rework common initialization

From: Christian Brauner

Date: Wed Sep 17 2025 - 06:28:50 EST


The current scheme still involves a lot of open-coding and copy-pasing
and bleeds a lot of unnecessary details into actual namespace
implementers. Encapsulate it in the common helpers and simplify it all.

Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>
---
Christian Brauner (9):
uts: split namespace into separate header
mnt: expose pointer to init_mnt_ns
nscommon: move to separate file
cgroup: split namespace into separate header
nsfs: add inode number for anon namespace
mnt: simplify ns_common_init() handling
net: centralize ns_common initialization
nscommon: simplify initialization
ns: add ns_common_free()

fs/namespace.c | 16 ++++++----
include/linux/cgroup.h | 51 +------------------------------
include/linux/cgroup_namespace.h | 56 ++++++++++++++++++++++++++++++++++
include/linux/mnt_namespace.h | 2 ++
include/linux/ns_common.h | 43 ++++++++++++++++++++++++++
include/linux/proc_ns.h | 21 -------------
include/linux/uts_namespace.h | 65 ++++++++++++++++++++++++++++++++++++++++
include/linux/utsname.h | 58 +----------------------------------
include/uapi/linux/nsfs.h | 3 ++
ipc/namespace.c | 6 ++--
kernel/Makefile | 2 +-
kernel/cgroup/namespace.c | 4 +--
kernel/nscommon.c | 25 ++++++++++++++++
kernel/pid_namespace.c | 6 ++--
kernel/time/namespace.c | 4 +--
kernel/user_namespace.c | 6 ++--
kernel/utsname.c | 4 +--
net/core/net_namespace.c | 23 ++------------
18 files changed, 225 insertions(+), 170 deletions(-)
---
base-commit: bf56a464f4ad7143c6e4b581b411f682f345a344
change-id: 20250917-work-namespace-ns_common-5859468e4c55