Commit | Line | Data |
---|---|---|
6b3286ed KK |
1 | #ifndef _NAMESPACE_H_ |
2 | #define _NAMESPACE_H_ | |
3 | #ifdef __KERNEL__ | |
4 | ||
5 | #include <linux/mount.h> | |
6 | #include <linux/sched.h> | |
7 | #include <linux/nsproxy.h> | |
a1a2c409 | 8 | #include <linux/seq_file.h> |
6b3286ed KK |
9 | |
10 | struct mnt_namespace { | |
11 | atomic_t count; | |
12 | struct vfsmount * root; | |
13 | struct list_head list; | |
14 | wait_queue_head_t poll; | |
15 | int event; | |
16 | }; | |
17 | ||
a1a2c409 MS |
18 | struct proc_mounts { |
19 | struct seq_file m; /* must be the first element */ | |
20 | struct mnt_namespace *ns; | |
21 | struct path root; | |
22 | int event; | |
23 | }; | |
24 | ||
5ad4e53b AV |
25 | struct fs_struct; |
26 | ||
cf8d2c11 | 27 | extern struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt); |
213dd266 | 28 | extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, |
6b3286ed | 29 | struct fs_struct *); |
616511d0 | 30 | extern void put_mnt_ns(struct mnt_namespace *ns); |
6b3286ed KK |
31 | |
32 | static inline void exit_mnt_ns(struct task_struct *p) | |
33 | { | |
34 | struct mnt_namespace *ns = p->nsproxy->mnt_ns; | |
35 | if (ns) | |
36 | put_mnt_ns(ns); | |
37 | } | |
38 | ||
39 | static inline void get_mnt_ns(struct mnt_namespace *ns) | |
40 | { | |
41 | atomic_inc(&ns->count); | |
42 | } | |
43 | ||
a1a2c409 | 44 | extern const struct seq_operations mounts_op; |
2d4d4864 | 45 | extern const struct seq_operations mountinfo_op; |
a1a2c409 MS |
46 | extern const struct seq_operations mountstats_op; |
47 | ||
6b3286ed KK |
48 | #endif |
49 | #endif |