aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/ns_common.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/ns_common.h b/include/linux/ns_common.h
index f5b68b8abb5433..3a72c3f81eca42 100644
--- a/include/linux/ns_common.h
+++ b/include/linux/ns_common.h
@@ -119,6 +119,16 @@ void __ns_common_free(struct ns_common *ns);
struct user_namespace *: CLONE_NEWUSER, \
struct uts_namespace *: CLONE_NEWUTS)
+#define NS_COMMON_INIT(nsname, refs) \
+{ \
+ .ns_type = ns_common_type(&nsname), \
+ .ns_id = 0, \
+ .inum = ns_init_inum(&nsname), \
+ .ops = to_ns_operations(&nsname), \
+ .stashed = NULL, \
+ .__ns_ref = REFCOUNT_INIT(refs), \
+}
+
#define ns_common_init(__ns) \
__ns_common_init(to_ns_common(__ns), \
ns_common_type(__ns), \