blob: 29304855652d4c1aa600721d9fddaf1354736a87 [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;
Miklos Szeredia1a2c402008-03-27 13:06:24 +010021};
22
Al Viro5ad4e532009-03-29 19:50:06 -040023struct fs_struct;
24
Linus Torvaldsa2770d82009-12-17 12:51:05 -080025extern struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt);
Eric W. Biederman213dd262007-07-15 23:41:15 -070026extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
Kirill Korotaev6b3286e2006-12-08 02:37:56 -080027 struct fs_struct *);
Trond Myklebust616511d2009-06-22 15:09:13 -040028extern void put_mnt_ns(struct mnt_namespace *ns);
Kirill Korotaev6b3286e2006-12-08 02:37:56 -080029static inline void get_mnt_ns(struct mnt_namespace *ns)
30{
31 atomic_inc(&ns->count);
32}
33
Miklos Szeredia1a2c402008-03-27 13:06:24 +010034extern const struct seq_operations mounts_op;
Ram Pai2d4d4862008-03-27 13:06:25 +010035extern const struct seq_operations mountinfo_op;
Miklos Szeredia1a2c402008-03-27 13:06:24 +010036extern const struct seq_operations mountstats_op;
Al Viro9f5596a2010-02-05 00:40:25 -050037extern int mnt_had_events(struct proc_mounts *);
Miklos Szeredia1a2c402008-03-27 13:06:24 +010038
Kirill Korotaev6b3286e2006-12-08 02:37:56 -080039#endif
40#endif