1 #ifndef _LINUX_USER_NAMESPACE_H
2 #define _LINUX_USER_NAMESPACE_H
4 #include <linux/kref.h>
5 #include <linux/nsproxy.h>
6 #include <linux/sched.h>
8 #define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 8)
9 #define UIDHASH_SZ (1 << UIDHASH_BITS)
11 struct user_namespace {
13 struct list_head uidhash_table[UIDHASH_SZ];
14 struct user_struct *root_user;
17 extern struct user_namespace init_user_ns;
21 static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
28 extern struct user_namespace *copy_user_ns(int flags,
29 struct user_namespace *old_ns);
30 extern void free_user_ns(struct kref *kref);
32 static inline void put_user_ns(struct user_namespace *ns)
35 kref_put(&ns->kref, free_user_ns);
40 static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
45 static inline struct user_namespace *copy_user_ns(int flags,
46 struct user_namespace *old_ns)
51 static inline void put_user_ns(struct user_namespace *ns)
57 #endif /* _LINUX_USER_H */