Kirill Korotaev | 6b3286e | 2006-12-08 02:37:56 -0800 | [diff] [blame] | 1 | #ifndef _NAMESPACE_H_ |
| 2 | #define _NAMESPACE_H_ |
| 3 | #ifdef __KERNEL__ |
| 4 | |
Alexey Dobriyan | b43f3cb | 2009-07-08 01:54:37 +0400 | [diff] [blame] | 5 | #include <linux/path.h> |
Miklos Szeredi | a1a2c40 | 2008-03-27 13:06:24 +0100 | [diff] [blame] | 6 | #include <linux/seq_file.h> |
Alexey Dobriyan | b43f3cb | 2009-07-08 01:54:37 +0400 | [diff] [blame] | 7 | #include <linux/wait.h> |
Kirill Korotaev | 6b3286e | 2006-12-08 02:37:56 -0800 | [diff] [blame] | 8 | |
| 9 | struct mnt_namespace { |
| 10 | atomic_t count; |
| 11 | struct vfsmount * root; |
| 12 | struct list_head list; |
| 13 | wait_queue_head_t poll; |
| 14 | int event; |
| 15 | }; |
| 16 | |
Miklos Szeredi | a1a2c40 | 2008-03-27 13:06:24 +0100 | [diff] [blame] | 17 | struct proc_mounts { |
| 18 | struct seq_file m; /* must be the first element */ |
| 19 | struct mnt_namespace *ns; |
| 20 | struct path root; |
| 21 | int event; |
| 22 | }; |
| 23 | |
Al Viro | 5ad4e53 | 2009-03-29 19:50:06 -0400 | [diff] [blame] | 24 | struct fs_struct; |
| 25 | |
Linus Torvalds | a2770d8 | 2009-12-17 12:51:05 -0800 | [diff] [blame] | 26 | extern struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt); |
Eric W. Biederman | 213dd26 | 2007-07-15 23:41:15 -0700 | [diff] [blame] | 27 | extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, |
Kirill Korotaev | 6b3286e | 2006-12-08 02:37:56 -0800 | [diff] [blame] | 28 | struct fs_struct *); |
Trond Myklebust | 616511d | 2009-06-22 15:09:13 -0400 | [diff] [blame] | 29 | extern void put_mnt_ns(struct mnt_namespace *ns); |
Kirill Korotaev | 6b3286e | 2006-12-08 02:37:56 -0800 | [diff] [blame] | 30 | static inline void get_mnt_ns(struct mnt_namespace *ns) |
| 31 | { |
| 32 | atomic_inc(&ns->count); |
| 33 | } |
| 34 | |
Miklos Szeredi | a1a2c40 | 2008-03-27 13:06:24 +0100 | [diff] [blame] | 35 | extern const struct seq_operations mounts_op; |
Ram Pai | 2d4d486 | 2008-03-27 13:06:25 +0100 | [diff] [blame] | 36 | extern const struct seq_operations mountinfo_op; |
Miklos Szeredi | a1a2c40 | 2008-03-27 13:06:24 +0100 | [diff] [blame] | 37 | extern const struct seq_operations mountstats_op; |
| 38 | |
Kirill Korotaev | 6b3286e | 2006-12-08 02:37:56 -0800 | [diff] [blame] | 39 | #endif |
| 40 | #endif |