mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
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>
37 lines
916 B
C
37 lines
916 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _LINUX_NS_COMMON_H
|
|
#define _LINUX_NS_COMMON_H
|
|
|
|
#include <linux/refcount.h>
|
|
|
|
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;
|
|
unsigned int inum;
|
|
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
|