Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+20 -11
+20
include/linux/ns_common.h
··· 6 6 7 7 struct proc_ns_operations; 8 8 9 + struct cgroup_namespace; 10 + struct ipc_namespace; 11 + struct mnt_namespace; 12 + struct net; 13 + struct pid_namespace; 14 + struct time_namespace; 15 + struct user_namespace; 16 + struct uts_namespace; 17 + 9 18 struct ns_common { 10 19 struct dentry *stashed; 11 20 const struct proc_ns_operations *ops; 12 21 unsigned int inum; 13 22 refcount_t count; 14 23 }; 24 + 25 + #define to_ns_common(__ns) \ 26 + _Generic((__ns), \ 27 + struct cgroup_namespace *: &(__ns)->ns, \ 28 + struct ipc_namespace *: &(__ns)->ns, \ 29 + struct mnt_namespace *: &(__ns)->ns, \ 30 + struct net *: &(__ns)->ns, \ 31 + struct pid_namespace *: &(__ns)->ns, \ 32 + struct time_namespace *: &(__ns)->ns, \ 33 + struct user_namespace *: &(__ns)->ns, \ 34 + struct uts_namespace *: &(__ns)->ns) 15 35 16 36 #endif
-11
include/linux/nsproxy.h
··· 42 42 }; 43 43 extern struct nsproxy init_nsproxy; 44 44 45 - #define to_ns_common(__ns) \ 46 - _Generic((__ns), \ 47 - struct cgroup_namespace *: &(__ns->ns), \ 48 - struct ipc_namespace *: &(__ns->ns), \ 49 - struct net *: &(__ns->ns), \ 50 - struct pid_namespace *: &(__ns->ns), \ 51 - struct mnt_namespace *: &(__ns->ns), \ 52 - struct time_namespace *: &(__ns->ns), \ 53 - struct user_namespace *: &(__ns->ns), \ 54 - struct uts_namespace *: &(__ns->ns)) 55 - 56 45 /* 57 46 * A structure to encompass all bits needed to install 58 47 * a partial or complete new set of namespaces.