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

From: Michal Koutný

Date: Thu Sep 18 2025 - 08:12:47 EST


Hi.

On Thu, Sep 18, 2025 at 12:11:59PM +0200, Christian Brauner <brauner@xxxxxxxxxx> wrote:
> --- 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

Attachment: signature.asc
Description: PGP signature