[PATCH 06/14] time: port to ns_ref_*() helpers

Christian Brauner posted 14 patches 1 week, 6 days ago
[PATCH 06/14] time: port to ns_ref_*() helpers
Posted by Christian Brauner 1 week, 6 days ago
Stop accessing ns.count directly.

Signed-off-by: Christian Brauner <brauner@kernel.org>
---
 include/linux/time_namespace.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/time_namespace.h b/include/linux/time_namespace.h
index a47a4ce4183e..f3b9567cf1f4 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);
 }
 

-- 
2.47.3
Re: [PATCH 06/14] time: port to ns_ref_*() helpers
Posted by Thomas Gleixner 1 week, 4 days ago
On Thu, Sep 18 2025 at 12:11, Christian Brauner wrote:
> Stop accessing ns.count directly.
>
> Signed-off-by: Christian Brauner <brauner@kernel.org>

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>