Thread (20 messages) 20 messages, 5 authors, 2025-09-21

Re: [PATCH 14/14] ns: rename to __ns_ref

From: Michal Koutný <mkoutny@suse.com>
Date: 2025-09-18 12:12:47
Also in: cgroups, linux-fsdevel, lkml

Hi.

On Thu, Sep 18, 2025 at 12:11:59PM +0200, Christian Brauner [off-list ref] wrote:
quoted hunk ↗ jump to hunk
--- a/include/linux/ns_common.h
+++ b/include/linux/ns_common.h
@@ -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 */
+	refcount_t __ns_ref; /* do not use directly unless initializing */

Or a helper macro like
#define NS_REFCOUNT_INIT(v)  .ns.__ns_ref = REFCOUNT_INIT((v))
 /* 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,
The double underscore stands out here.

Regards,
Michal

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help