]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ns: move to_ns_common() to ns_common.h
authorChristian Brauner <brauner@kernel.org>
Fri, 12 Sep 2025 11:52:28 +0000 (13:52 +0200)
committerChristian Brauner <brauner@kernel.org>
Fri, 19 Sep 2025 12:26:12 +0000 (14:26 +0200)
Move the helper to ns_common.h where it belongs.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/ns_common.h
include/linux/nsproxy.h

index 7d22ea50b09841ed2f764273564e53588e9b7a4e..bc2e0758e1c939cf2ff852c502c69398bd0ce6d9 100644 (file)
@@ -6,6 +6,15 @@
 
 struct proc_ns_operations;
 
+struct cgroup_namespace;
+struct ipc_namespace;
+struct mnt_namespace;
+struct net;
+struct pid_namespace;
+struct time_namespace;
+struct user_namespace;
+struct uts_namespace;
+
 struct ns_common {
        struct dentry *stashed;
        const struct proc_ns_operations *ops;
@@ -13,4 +22,15 @@ struct ns_common {
        refcount_t count;
 };
 
+#define to_ns_common(__ns)                              \
+       _Generic((__ns),                                \
+               struct cgroup_namespace *: &(__ns)->ns, \
+               struct ipc_namespace *:    &(__ns)->ns, \
+               struct mnt_namespace *:    &(__ns)->ns, \
+               struct net *:              &(__ns)->ns, \
+               struct pid_namespace *:    &(__ns)->ns, \
+               struct time_namespace *:   &(__ns)->ns, \
+               struct user_namespace *:   &(__ns)->ns, \
+               struct uts_namespace *:    &(__ns)->ns)
+
 #endif
index dab6a1734a2265d4e75997a9da00810a7ef832ec..e6bec522b1391fc2ea0c5d0082f818c02c87b77d 100644 (file)
@@ -42,17 +42,6 @@ struct nsproxy {
 };
 extern struct nsproxy init_nsproxy;
 
-#define to_ns_common(__ns)                              \
-       _Generic((__ns),                                \
-               struct cgroup_namespace *: &(__ns->ns), \
-               struct ipc_namespace *:    &(__ns->ns), \
-               struct net *:              &(__ns->ns), \
-               struct pid_namespace *:    &(__ns->ns), \
-               struct mnt_namespace *:    &(__ns->ns), \
-               struct time_namespace *:   &(__ns->ns), \
-               struct user_namespace *:   &(__ns->ns), \
-               struct uts_namespace *:    &(__ns->ns))
-
 /*
  * A structure to encompass all bits needed to install
  * a partial or complete new set of namespaces.