Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ns: drop custom reference count initialization for initial namespaces

Initial namespaces don't modify their reference count anymore.
They remain fixed at one so drop the custom refcount initializations.

Link: https://patch.msgid.link/20251110-work-namespace-nstree-fixes-v1-16-e8a9264e0fb9@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>

+9 -9
+1 -1
fs/namespace.c
··· 5986 5986 } 5987 5987 5988 5988 struct mnt_namespace init_mnt_ns = { 5989 - .ns = NS_COMMON_INIT(init_mnt_ns, 1), 5989 + .ns = NS_COMMON_INIT(init_mnt_ns), 5990 5990 .user_ns = &init_user_ns, 5991 5991 .passive = REFCOUNT_INIT(1), 5992 5992 .mounts = RB_ROOT,
+2 -2
include/linux/ns_common.h
··· 26 26 return ns->ns_id <= NS_LAST_INIT_ID; 27 27 } 28 28 29 - #define NS_COMMON_INIT(nsname, refs) \ 29 + #define NS_COMMON_INIT(nsname) \ 30 30 { \ 31 31 .ns_type = ns_common_type(&nsname), \ 32 32 .ns_id = ns_init_id(&nsname), \ 33 33 .inum = ns_init_inum(&nsname), \ 34 34 .ops = to_ns_operations(&nsname), \ 35 35 .stashed = NULL, \ 36 - .__ns_ref = REFCOUNT_INIT(refs), \ 36 + .__ns_ref = REFCOUNT_INIT(1), \ 37 37 .__ns_ref_active = ATOMIC_INIT(1), \ 38 38 .ns_unified_node.ns_list_entry = LIST_HEAD_INIT(nsname.ns.ns_unified_node.ns_list_entry), \ 39 39 .ns_tree_node.ns_list_entry = LIST_HEAD_INIT(nsname.ns.ns_tree_node.ns_list_entry), \
+1 -1
init/version-timestamp.c
··· 8 8 #include <linux/utsname.h> 9 9 10 10 struct uts_namespace init_uts_ns = { 11 - .ns = NS_COMMON_INIT(init_uts_ns, 2), 11 + .ns = NS_COMMON_INIT(init_uts_ns), 12 12 .name = { 13 13 .sysname = UTS_SYSNAME, 14 14 .nodename = UTS_NODENAME,
+1 -1
ipc/msgutil.c
··· 27 27 * and not CONFIG_IPC_NS. 28 28 */ 29 29 struct ipc_namespace init_ipc_ns = { 30 - .ns = NS_COMMON_INIT(init_ipc_ns, 1), 30 + .ns = NS_COMMON_INIT(init_ipc_ns), 31 31 .user_ns = &init_user_ns, 32 32 }; 33 33
+1 -1
kernel/cgroup/cgroup.c
··· 250 250 251 251 /* cgroup namespace for init task */ 252 252 struct cgroup_namespace init_cgroup_ns = { 253 - .ns = NS_COMMON_INIT(init_cgroup_ns, 2), 253 + .ns = NS_COMMON_INIT(init_cgroup_ns), 254 254 .user_ns = &init_user_ns, 255 255 .root_cset = &init_css_set, 256 256 };
+1 -1
kernel/pid.c
··· 71 71 * the scheme scales to up to 4 million PIDs, runtime. 72 72 */ 73 73 struct pid_namespace init_pid_ns = { 74 - .ns = NS_COMMON_INIT(init_pid_ns, 2), 74 + .ns = NS_COMMON_INIT(init_pid_ns), 75 75 .idr = IDR_INIT(init_pid_ns.idr), 76 76 .pid_allocated = PIDNS_ADDING, 77 77 .level = 0,
+1 -1
kernel/time/namespace.c
··· 478 478 }; 479 479 480 480 struct time_namespace init_time_ns = { 481 - .ns = NS_COMMON_INIT(init_time_ns, 3), 481 + .ns = NS_COMMON_INIT(init_time_ns), 482 482 .user_ns = &init_user_ns, 483 483 .frozen_offsets = true, 484 484 };
+1 -1
kernel/user.c
··· 35 35 * and 1 for... ? 36 36 */ 37 37 struct user_namespace init_user_ns = { 38 - .ns = NS_COMMON_INIT(init_user_ns, 3), 38 + .ns = NS_COMMON_INIT(init_user_ns), 39 39 .uid_map = { 40 40 { 41 41 .extent[0] = {