diff options
| author | Thomas Weißschuh <thomas.weissschuh@linutronix.de> | 2026-03-30 09:07:55 +0200 |
|---|---|---|
| committer | Thomas Gleixner <tglx@kernel.org> | 2026-04-01 17:13:35 +0200 |
| commit | c2de5a5be4d60af5f928a2dd2b0f73e17358e346 (patch) | |
| tree | 75c872f663d2762d2c4b33ffbfa3ff6da4944cda /include/linux | |
| parent | 1b6c89285d37114d7efe8ab04102a542581cd7da (diff) | |
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 <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260330-timens-cleanup-v1-1-936e91c9dd30@linutronix.de
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/time_namespace.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/time_namespace.h b/include/linux/time_namespace.h index c1de21a27c34..58bd9728df58 100644 --- a/include/linux/time_namespace.h +++ b/include/linux/time_namespace.h @@ -8,6 +8,7 @@ #include <linux/ns_common.h> #include <linux/err.h> #include <linux/time64.h> +#include <linux/cleanup.h> 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 */ |
