projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8627bc8
)
ns: add NS_COMMON_INIT()
author
Christian Brauner
<brauner@kernel.org>
Mon, 3 Nov 2025 15:10:10 +0000
(16:10 +0100)
committer
Christian Brauner
<brauner@kernel.org>
Mon, 3 Nov 2025 16:41:16 +0000
(17:41 +0100)
Add an initializer that can be used for the ns common initialization for
static namespace such as most init namespaces.
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Link:
https://patch.msgid.link/87ecqhy2y5.ffs@tglx
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/ns_common.h
patch
|
blob
|
history
diff --git
a/include/linux/ns_common.h
b/include/linux/ns_common.h
index
f5b68b8
..
3a72c3f
100644
(file)
--- 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), \