xref: /linux/kernel/time/namespace_internal.h (revision f21f7b5162e9dbde6d3d5ce727d4ca2552d76ce9)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _TIME_NAMESPACE_INTERNAL_H
3 #define _TIME_NAMESPACE_INTERNAL_H
4 
5 #include <linux/mutex.h>
6 
7 struct time_namespace;
8 
9 /*
10  * Protects possibly multiple offsets writers racing each other
11  * and tasks entering the namespace.
12  */
13 extern struct mutex timens_offset_lock;
14 
15 #ifdef CONFIG_TIME_NS_VDSO
16 int timens_vdso_alloc_vvar_page(struct time_namespace *ns);
17 void timens_vdso_free_vvar_page(struct time_namespace *ns);
18 #else /* !CONFIG_TIME_NS_VDSO */
19 static inline int timens_vdso_alloc_vvar_page(struct time_namespace *ns)
20 {
21 	return 0;
22 }
23 static inline void timens_vdso_free_vvar_page(struct time_namespace *ns)
24 {
25 }
26 #endif /* CONFIG_TIME_NS_VDSO */
27 
28 #endif /* _TIME_NAMESPACE_INTERNAL_H */
29