From: Thomas Weißschuh Date: Mon, 30 Mar 2026 07:07:55 +0000 (+0200) Subject: timens: Add a __free() wrapper for put_time_ns() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2de5a5be4d60af5f928a2dd2b0f73e17358e346;p=thirdparty%2Fkernel%2Flinux.git timens: Add a __free() wrapper for put_time_ns() The wrapper will be used to simplify cleanups of 'struct time_namespace'. Signed-off-by: Thomas Weißschuh Signed-off-by: Thomas Gleixner Link: https://patch.msgid.link/20260330-timens-cleanup-v1-1-936e91c9dd30@linutronix.de --- diff --git a/include/linux/time_namespace.h b/include/linux/time_namespace.h index c1de21a27c340..58bd9728df583 100644 --- a/include/linux/time_namespace.h +++ b/include/linux/time_namespace.h @@ -8,6 +8,7 @@ #include #include #include +#include struct user_namespace; extern struct user_namespace init_user_ns; @@ -171,4 +172,6 @@ static inline struct page *find_timens_vvar_page(struct vm_area_struct *vma) } #endif /* CONFIG_TIME_NS_VDSO */ +DEFINE_FREE(time_ns, struct time_namespace *, if (_T) put_time_ns(_T)) + #endif /* _LINUX_TIMENS_H */