]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ns: rename to __ns_ref
authorChristian Brauner <brauner@kernel.org>
Thu, 18 Sep 2025 10:11:59 +0000 (12:11 +0200)
committerChristian Brauner <brauner@kernel.org>
Fri, 19 Sep 2025 14:22:38 +0000 (16:22 +0200)
Make it easier to grep and rename to ns_count.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/namespace.c
include/linux/ns_common.h
init/version-timestamp.c
ipc/msgutil.c
kernel/cgroup/cgroup.c
kernel/nscommon.c
kernel/pid.c
kernel/time/namespace.c
kernel/user.c

index 9109069d85cd8e3654a6585a81adab74a9bb42f8..740a6ba524d0ce7a2f9436405f7a465d71924c23 100644 (file)
@@ -6015,7 +6015,7 @@ struct mnt_namespace init_mnt_ns = {
        .ns.inum        = PROC_MNT_INIT_INO,
        .ns.ops         = &mntns_operations,
        .user_ns        = &init_user_ns,
-       .ns.count       = REFCOUNT_INIT(1),
+       .ns.__ns_ref    = REFCOUNT_INIT(1),
        .passive        = REFCOUNT_INIT(1),
        .mounts         = RB_ROOT,
        .poll           = __WAIT_QUEUE_HEAD_INITIALIZER(init_mnt_ns.poll),
index 65e258e1fdc6dd4091da0c9473037eacc420950b..aea8528d799a60562504c484ca3e0b872a3d949c 100644 (file)
@@ -29,7 +29,7 @@ struct ns_common {
        struct dentry *stashed;
        const struct proc_ns_operations *ops;
        unsigned int inum;
-       refcount_t count;
+       refcount_t __ns_ref; /* do not use directly */
        union {
                struct {
                        u64 ns_id;
@@ -93,19 +93,19 @@ void __ns_common_free(struct ns_common *ns);
 
 static __always_inline __must_check bool __ns_ref_put(struct ns_common *ns)
 {
-       return refcount_dec_and_test(&ns->count);
+       return refcount_dec_and_test(&ns->__ns_ref);
 }
 
 static __always_inline __must_check bool __ns_ref_get(struct ns_common *ns)
 {
-       return refcount_inc_not_zero(&ns->count);
+       return refcount_inc_not_zero(&ns->__ns_ref);
 }
 
-#define ns_ref_read(__ns) refcount_read(&to_ns_common((__ns))->count)
-#define ns_ref_inc(__ns) refcount_inc(&to_ns_common((__ns))->count)
+#define ns_ref_read(__ns) refcount_read(&to_ns_common((__ns))->__ns_ref)
+#define ns_ref_inc(__ns) refcount_inc(&to_ns_common((__ns))->__ns_ref)
 #define ns_ref_get(__ns) __ns_ref_get(to_ns_common((__ns)))
 #define ns_ref_put(__ns) __ns_ref_put(to_ns_common((__ns)))
 #define ns_ref_put_and_lock(__ns, __lock) \
-       refcount_dec_and_lock(&to_ns_common((__ns))->count, (__lock))
+       refcount_dec_and_lock(&to_ns_common((__ns))->__ns_ref, (__lock))
 
 #endif
index 043cbf80a766deec23a29e0cac70c22f9a149c6e..547e522e6016c11a160ea5f98224fde4df24f4d1 100644 (file)
@@ -8,7 +8,7 @@
 #include <linux/utsname.h>
 
 struct uts_namespace init_uts_ns = {
-       .ns.count = REFCOUNT_INIT(2),
+       .ns.__ns_ref = REFCOUNT_INIT(2),
        .name = {
                .sysname        = UTS_SYSNAME,
                .nodename       = UTS_NODENAME,
index bbf61275df41e11bf46738d987bf1b41b73b0cf4..d0f7dcf4c20840d82d00bd9e63a47b6ef96a3199 100644 (file)
@@ -27,7 +27,7 @@ DEFINE_SPINLOCK(mq_lock);
  * and not CONFIG_IPC_NS.
  */
 struct ipc_namespace init_ipc_ns = {
-       .ns.count = REFCOUNT_INIT(1),
+       .ns.__ns_ref = REFCOUNT_INIT(1),
        .user_ns = &init_user_ns,
        .ns.inum = PROC_IPC_INIT_INO,
 #ifdef CONFIG_IPC_NS
index 092e6bf081ed1fc6fca3d3f7f859ea47b76d053f..a0e24adceef005808b99b655cc157051262fc37b 100644 (file)
@@ -219,7 +219,7 @@ static bool have_favordynmods __ro_after_init = IS_ENABLED(CONFIG_CGROUP_FAVOR_D
 
 /* cgroup namespace for init task */
 struct cgroup_namespace init_cgroup_ns = {
-       .ns.count       = REFCOUNT_INIT(2),
+       .ns.__ns_ref    = REFCOUNT_INIT(2),
        .user_ns        = &init_user_ns,
        .ns.ops         = &cgroupns_operations,
        .ns.inum        = PROC_CGROUP_INIT_INO,
index 7c1b07e2a6c9ed1cc6a75bbdd8045511969df8fa..7aa2be6a0c32a717f679fc994267f24e8a824289 100644 (file)
@@ -5,7 +5,7 @@
 
 int __ns_common_init(struct ns_common *ns, const struct proc_ns_operations *ops, int inum)
 {
-       refcount_set(&ns->count, 1);
+       refcount_set(&ns->__ns_ref, 1);
        ns->stashed = NULL;
        ns->ops = ops;
        ns->ns_id = 0;
index c45a28c16cd256024f5bc1fbc70dfc2a9431ca38..e222426f745dd222f11dd4e337db7d1426016c00 100644 (file)
@@ -71,7 +71,7 @@ static int pid_max_max = PID_MAX_LIMIT;
  * the scheme scales to up to 4 million PIDs, runtime.
  */
 struct pid_namespace init_pid_ns = {
-       .ns.count = REFCOUNT_INIT(2),
+       .ns.__ns_ref = REFCOUNT_INIT(2),
        .idr = IDR_INIT(init_pid_ns.idr),
        .pid_allocated = PIDNS_ADDING,
        .level = 0,
index d49c73015d6ec30d9bb96daade0120658bd09597..d70bdfb7b0014acf550bbec01319c985fddad56f 100644 (file)
@@ -480,7 +480,7 @@ const struct proc_ns_operations timens_for_children_operations = {
 };
 
 struct time_namespace init_time_ns = {
-       .ns.count       = REFCOUNT_INIT(3),
+       .ns.__ns_ref    = REFCOUNT_INIT(3),
        .user_ns        = &init_user_ns,
        .ns.inum        = PROC_TIME_INIT_INO,
        .ns.ops         = &timens_operations,
index f46b1d41163b205d21729b482f84154f9d7a5f57..17a742fb4e10eff6d837c4b609052bf0962fae1f 100644 (file)
@@ -65,7 +65,7 @@ struct user_namespace init_user_ns = {
                        .nr_extents = 1,
                },
        },
-       .ns.count = REFCOUNT_INIT(3),
+       .ns.__ns_ref = REFCOUNT_INIT(3),
        .owner = GLOBAL_ROOT_UID,
        .group = GLOBAL_ROOT_GID,
        .ns.inum = PROC_USER_INIT_INO,