Skip to content

Commit 024596a

Browse files
committed
ns: rename to __ns_ref
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>
1 parent b3d8ff0 commit 024596a

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed

fs/namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6015,7 +6015,7 @@ struct mnt_namespace init_mnt_ns = {
60156015
.ns.inum = PROC_MNT_INIT_INO,
60166016
.ns.ops = &mntns_operations,
60176017
.user_ns = &init_user_ns,
6018-
.ns.count = REFCOUNT_INIT(1),
6018+
.ns.__ns_ref = REFCOUNT_INIT(1),
60196019
.passive = REFCOUNT_INIT(1),
60206020
.mounts = RB_ROOT,
60216021
.poll = __WAIT_QUEUE_HEAD_INITIALIZER(init_mnt_ns.poll),

include/linux/ns_common.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct ns_common {
2929
struct dentry *stashed;
3030
const struct proc_ns_operations *ops;
3131
unsigned int inum;
32-
refcount_t count;
32+
refcount_t __ns_ref; /* do not use directly */
3333
union {
3434
struct {
3535
u64 ns_id;
@@ -93,19 +93,19 @@ void __ns_common_free(struct ns_common *ns);
9393

9494
static __always_inline __must_check bool __ns_ref_put(struct ns_common *ns)
9595
{
96-
return refcount_dec_and_test(&ns->count);
96+
return refcount_dec_and_test(&ns->__ns_ref);
9797
}
9898

9999
static __always_inline __must_check bool __ns_ref_get(struct ns_common *ns)
100100
{
101-
return refcount_inc_not_zero(&ns->count);
101+
return refcount_inc_not_zero(&ns->__ns_ref);
102102
}
103103

104-
#define ns_ref_read(__ns) refcount_read(&to_ns_common((__ns))->count)
105-
#define ns_ref_inc(__ns) refcount_inc(&to_ns_common((__ns))->count)
104+
#define ns_ref_read(__ns) refcount_read(&to_ns_common((__ns))->__ns_ref)
105+
#define ns_ref_inc(__ns) refcount_inc(&to_ns_common((__ns))->__ns_ref)
106106
#define ns_ref_get(__ns) __ns_ref_get(to_ns_common((__ns)))
107107
#define ns_ref_put(__ns) __ns_ref_put(to_ns_common((__ns)))
108108
#define ns_ref_put_and_lock(__ns, __lock) \
109-
refcount_dec_and_lock(&to_ns_common((__ns))->count, (__lock))
109+
refcount_dec_and_lock(&to_ns_common((__ns))->__ns_ref, (__lock))
110110

111111
#endif

init/version-timestamp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <linux/utsname.h>
99

1010
struct uts_namespace init_uts_ns = {
11-
.ns.count = REFCOUNT_INIT(2),
11+
.ns.__ns_ref = REFCOUNT_INIT(2),
1212
.name = {
1313
.sysname = UTS_SYSNAME,
1414
.nodename = UTS_NODENAME,

ipc/msgutil.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ DEFINE_SPINLOCK(mq_lock);
2727
* and not CONFIG_IPC_NS.
2828
*/
2929
struct ipc_namespace init_ipc_ns = {
30-
.ns.count = REFCOUNT_INIT(1),
30+
.ns.__ns_ref = REFCOUNT_INIT(1),
3131
.user_ns = &init_user_ns,
3232
.ns.inum = PROC_IPC_INIT_INO,
3333
#ifdef CONFIG_IPC_NS

kernel/cgroup/cgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ static bool have_favordynmods __ro_after_init = IS_ENABLED(CONFIG_CGROUP_FAVOR_D
219219

220220
/* cgroup namespace for init task */
221221
struct cgroup_namespace init_cgroup_ns = {
222-
.ns.count = REFCOUNT_INIT(2),
222+
.ns.__ns_ref = REFCOUNT_INIT(2),
223223
.user_ns = &init_user_ns,
224224
.ns.ops = &cgroupns_operations,
225225
.ns.inum = PROC_CGROUP_INIT_INO,

kernel/nscommon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
int __ns_common_init(struct ns_common *ns, const struct proc_ns_operations *ops, int inum)
77
{
8-
refcount_set(&ns->count, 1);
8+
refcount_set(&ns->__ns_ref, 1);
99
ns->stashed = NULL;
1010
ns->ops = ops;
1111
ns->ns_id = 0;

kernel/pid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static int pid_max_max = PID_MAX_LIMIT;
7171
* the scheme scales to up to 4 million PIDs, runtime.
7272
*/
7373
struct pid_namespace init_pid_ns = {
74-
.ns.count = REFCOUNT_INIT(2),
74+
.ns.__ns_ref = REFCOUNT_INIT(2),
7575
.idr = IDR_INIT(init_pid_ns.idr),
7676
.pid_allocated = PIDNS_ADDING,
7777
.level = 0,

kernel/time/namespace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ const struct proc_ns_operations timens_for_children_operations = {
480480
};
481481

482482
struct time_namespace init_time_ns = {
483-
.ns.count = REFCOUNT_INIT(3),
483+
.ns.__ns_ref = REFCOUNT_INIT(3),
484484
.user_ns = &init_user_ns,
485485
.ns.inum = PROC_TIME_INIT_INO,
486486
.ns.ops = &timens_operations,

kernel/user.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct user_namespace init_user_ns = {
6565
.nr_extents = 1,
6666
},
6767
},
68-
.ns.count = REFCOUNT_INIT(3),
68+
.ns.__ns_ref = REFCOUNT_INIT(3),
6969
.owner = GLOBAL_ROOT_UID,
7070
.group = GLOBAL_ROOT_GID,
7171
.ns.inum = PROC_USER_INIT_INO,

0 commit comments

Comments
 (0)