[MIPS] IP27: Fix warning.
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / include / linux / pid_namespace.h
blob2833806d42c635de975f76c3c078dd113c01b8e3
1 #ifndef _LINUX_PID_NS_H
2 #define _LINUX_PID_NS_H
4 #include <linux/sched.h>
5 #include <linux/mm.h>
6 #include <linux/threads.h>
7 #include <linux/pid.h>
8 #include <linux/nsproxy.h>
9 #include <linux/kref.h>
11 struct pidmap {
12 atomic_t nr_free;
13 void *page;
16 #define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8)
18 struct pid_namespace {
19 struct kref kref;
20 struct pidmap pidmap[PIDMAP_ENTRIES];
21 int last_pid;
22 struct task_struct *child_reaper;
25 extern struct pid_namespace init_pid_ns;
27 static inline void get_pid_ns(struct pid_namespace *ns)
29 kref_get(&ns->kref);
32 extern int copy_pid_ns(int flags, struct task_struct *tsk);
33 extern void free_pid_ns(struct kref *kref);
35 static inline void put_pid_ns(struct pid_namespace *ns)
37 kref_put(&ns->kref, free_pid_ns);
40 static inline struct task_struct *child_reaper(struct task_struct *tsk)
42 return init_pid_ns.child_reaper;
45 #endif /* _LINUX_PID_NS_H */