blob: 0b89efc6f2155c1844775688c261d9ce52dc7957 [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;
Al Viro9f5596a2010-02-05 00:40:25 -050038extern int mnt_had_events(struct proc_mounts *);
Miklos Szeredia1a2c402008-03-27 13:06:24 +010039
Kirill Korotaev6b3286e2006-12-08 02:37:56 -080040#endif
41#endif