[PATCH] ppc64: inotify syscalls
[linux-2.6/mini2440.git] / include / linux / namespace.h
blob0e5a86f13b2f8b4bbac4b50f32836827fef9fae8
1 #ifndef _NAMESPACE_H_
2 #define _NAMESPACE_H_
3 #ifdef __KERNEL__
5 #include <linux/mount.h>
6 #include <linux/sched.h>
8 struct namespace {
9 atomic_t count;
10 struct vfsmount * root;
11 struct list_head list;
12 struct rw_semaphore sem;
15 extern int copy_namespace(int, struct task_struct *);
16 extern void __put_namespace(struct namespace *namespace);
18 static inline void put_namespace(struct namespace *namespace)
20 if (atomic_dec_and_lock(&namespace->count, &vfsmount_lock))
21 /* releases vfsmount_lock */
22 __put_namespace(namespace);
25 static inline void exit_namespace(struct task_struct *p)
27 struct namespace *namespace = p->namespace;
28 if (namespace) {
29 task_lock(p);
30 p->namespace = NULL;
31 task_unlock(p);
32 put_namespace(namespace);
36 static inline void get_namespace(struct namespace *namespace)
38 atomic_inc(&namespace->count);
41 #endif
42 #endif