summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-09-12 14:52:28 +0300
committerChristian Brauner <brauner@kernel.org>2025-09-19 15:26:12 +0300
commite3e1812f8e25ac277f5cc9249802365300c582e3 (patch)
tree180535e3701a2738a1883217acfdb298961a6eac /include/linux
parentfa8ee8627b7411f2157aad59d3d2a68ab00adeeb (diff)
downloadlinux-e3e1812f8e25ac277f5cc9249802365300c582e3.tar.xz
ns: move to_ns_common() to ns_common.h
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>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ns_common.h20
-rw-r--r--include/linux/nsproxy.h11
2 files changed, 20 insertions, 11 deletions
diff --git a/include/linux/ns_common.h b/include/linux/ns_common.h
index 7d22ea50b098..bc2e0758e1c9 100644
--- a/include/linux/ns_common.h
+++ b/include/linux/ns_common.h
@@ -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
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
index dab6a1734a22..e6bec522b139 100644
--- a/include/linux/nsproxy.h
+++ b/include/linux/nsproxy.h
@@ -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.