From: Christian Brauner Date: Thu, 18 Sep 2025 10:11:48 +0000 (+0200) Subject: cgroup: port to ns_ref_*() helpers X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=06099e374f3ab818f0501671b21493ba2e1b94b9;p=thirdparty%2Fkernel%2Fstable.git cgroup: port to ns_ref_*() helpers Stop accessing ns.count directly. Acked-by: Tejun Heo Reviewed-by: Jan Kara Signed-off-by: Christian Brauner --- diff --git a/include/linux/cgroup_namespace.h b/include/linux/cgroup_namespace.h index c02bb76c5e328..b7dbf4d623d26 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); }