summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-09-18 12:11:48 +0200
committerChristian Brauner <brauner@kernel.org>2025-09-19 16:22:36 +0200
commit06099e374f3ab818f0501671b21493ba2e1b94b9 (patch)
tree7c57a081f19c480b0e657255948872c49def5798
parent2e9e6972279fec7dd352ff05abe596e55988ec41 (diff)
cgroup: port to ns_ref_*() helpers
Stop accessing ns.count directly. Acked-by: Tejun Heo <tj@kernel.org> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
-rw-r--r--include/linux/cgroup_namespace.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/cgroup_namespace.h b/include/linux/cgroup_namespace.h
index c02bb76c5e32..b7dbf4d623d2 100644
--- a/include/linux/cgroup_namespace.h
+++ b/include/linux/cgroup_namespace.h
@@ -29,12 +29,12 @@ int cgroup_path_ns(struct cgroup *cgrp, char *buf, size_t buflen,
static inline void get_cgroup_ns(struct cgroup_namespace *ns)
{
- refcount_inc(&ns->ns.count);
+ ns_ref_inc(ns);
}
static inline void put_cgroup_ns(struct cgroup_namespace *ns)
{
- if (refcount_dec_and_test(&ns->ns.count))
+ if (ns_ref_put(ns))
free_cgroup_ns(ns);
}