usb: navman kill urb cleanup
[linux-2.6/linux-mips.git] / include / linux / namespace.h
blobd137009f0b2be0feb70efcffba537f899195865d
1 #ifndef _NAMESPACE_H_
2 #define _NAMESPACE_H_
3 #ifdef __KERNEL__
5 #include <linux/mount.h>
6 #include <linux/sched.h>
7 #include <linux/nsproxy.h>
9 struct namespace {
10 atomic_t count;
11 struct vfsmount * root;
12 struct list_head list;
13 wait_queue_head_t poll;
14 int event;
17 extern int copy_namespace(int, struct task_struct *);
18 extern void __put_namespace(struct namespace *namespace);
19 extern struct namespace *dup_namespace(struct task_struct *, struct fs_struct *);
21 static inline void put_namespace(struct namespace *namespace)
23 if (atomic_dec_and_lock(&namespace->count, &vfsmount_lock))
24 /* releases vfsmount_lock */
25 __put_namespace(namespace);
28 static inline void exit_namespace(struct task_struct *p)
30 struct namespace *namespace = p->nsproxy->namespace;
31 if (namespace) {
32 put_namespace(namespace);
36 static inline void get_namespace(struct namespace *namespace)
38 atomic_inc(&namespace->count);
41 #endif
42 #endif