WorkStruct: Separate delayable and non-delayable events.
[deliverable/linux.git] / include / linux / namespace.h
CommitLineData
1da177e4
LT
1#ifndef _NAMESPACE_H_
2#define _NAMESPACE_H_
3#ifdef __KERNEL__
4
5#include <linux/mount.h>
6#include <linux/sched.h>
1651e14e 7#include <linux/nsproxy.h>
1da177e4
LT
8
9struct namespace {
10 atomic_t count;
11 struct vfsmount * root;
12 struct list_head list;
5addc5dd
AV
13 wait_queue_head_t poll;
14 int event;
1da177e4
LT
15};
16
1da177e4
LT
17extern int copy_namespace(int, struct task_struct *);
18extern void __put_namespace(struct namespace *namespace);
741a2951 19extern struct namespace *dup_namespace(struct task_struct *, struct fs_struct *);
1da177e4
LT
20
21static inline void put_namespace(struct namespace *namespace)
22{
1ce88cf4
MS
23 if (atomic_dec_and_lock(&namespace->count, &vfsmount_lock))
24 /* releases vfsmount_lock */
1da177e4
LT
25 __put_namespace(namespace);
26}
27
28static inline void exit_namespace(struct task_struct *p)
29{
1651e14e 30 struct namespace *namespace = p->nsproxy->namespace;
1da177e4 31 if (namespace) {
1da177e4
LT
32 put_namespace(namespace);
33 }
34}
35
36static inline void get_namespace(struct namespace *namespace)
37{
38 atomic_inc(&namespace->count);
39}
40
41#endif
42#endif
This page took 0.315031 seconds and 5 git commands to generate.