blob: d74785c2393ad03976925e8ea6b63e3716718b79 [file] [log] [blame]
Kirill Korotaev6b3286e2006-12-08 02:37:56 -08001#ifndef _NAMESPACE_H_
2#define _NAMESPACE_H_
3#ifdef __KERNEL__
4
Alexey Dobriyanb43f3cb2009-07-08 01:54:37 +04005#include <linux/path.h>
Miklos Szeredia1a2c402008-03-27 13:06:24 +01006#include <linux/seq_file.h>
Alexey Dobriyanb43f3cb2009-07-08 01:54:37 +04007#include <linux/wait.h>
Kirill Korotaev6b3286e2006-12-08 02:37:56 -08008
9struct 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 Szeredia1a2c402008-03-27 13:06:24 +010017struct 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 Viro5ad4e532009-03-29 19:50:06 -040024struct fs_struct;
25
Linus Torvaldsa2770d82009-12-17 12:51:05 -080026extern struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt);
Eric W. Biederman213dd262007-07-15 23:41:15 -070027extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
Kirill Korotaev6b3286e2006-12-08 02:37:56 -080028 struct fs_struct *);
Trond Myklebust616511d2009-06-22 15:09:13 -040029extern void put_mnt_ns(struct mnt_namespace *ns);
Kirill Korotaev6b3286e2006-12-08 02:37:56 -080030static inline void get_mnt_ns(struct mnt_namespace *ns)
31{
32 atomic_inc(&ns->count);
33}
34
Miklos Szeredia1a2c402008-03-27 13:06:24 +010035extern const struct seq_operations mounts_op;
Ram Pai2d4d4862008-03-27 13:06:25 +010036extern const struct seq_operations mountinfo_op;
Miklos Szeredia1a2c402008-03-27 13:06:24 +010037extern const struct seq_operations mountstats_op;
38
Kirill Korotaev6b3286e2006-12-08 02:37:56 -080039#endif
40#endif