From: Christian Brauner Date: Thu, 18 Sep 2025 10:11:51 +0000 (+0200) Subject: time: port to ns_ref_*() helpers X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0c173f1fa02c0b08720aa8aa0cc91c3063146ae;p=thirdparty%2Fkernel%2Fstable.git time: port to ns_ref_*() helpers Stop accessing ns.count directly. Reviewed-by: Jan Kara Signed-off-by: Christian Brauner --- diff --git a/include/linux/time_namespace.h b/include/linux/time_namespace.h index a47a4ce4183e1..f3b9567cf1f4f 100644 --- a/include/linux/time_namespace.h +++ b/include/linux/time_namespace.h @@ -44,7 +44,7 @@ extern void timens_commit(struct task_struct *tsk, struct time_namespace *ns); static inline struct time_namespace *get_time_ns(struct time_namespace *ns) { - refcount_inc(&ns->ns.count); + ns_ref_inc(ns); return ns; } @@ -57,7 +57,7 @@ struct page *find_timens_vvar_page(struct vm_area_struct *vma); static inline void put_time_ns(struct time_namespace *ns) { - if (refcount_dec_and_test(&ns->ns.count)) + if (ns_ref_put(ns)) free_time_ns(ns); }