blob: 299d11af5f79e1e99ab06065979c07018a210d65 [file] [log] [blame]
Kirill Korotaev6b3286e2006-12-08 02:37:56 -08001#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>
Miklos Szeredia1a2c402008-03-27 13:06:24 +01008#include <linux/seq_file.h>
Kirill Korotaev6b3286e2006-12-08 02:37:56 -08009
10struct 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
Miklos Szeredia1a2c402008-03-27 13:06:24 +010018struct 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
Al Viro5ad4e532009-03-29 19:50:06 -040025struct fs_struct;
26
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 -080030
31static inline void exit_mnt_ns(struct task_struct *p)
32{
33 struct mnt_namespace *ns = p->nsproxy->mnt_ns;
34 if (ns)
35 put_mnt_ns(ns);
36}
37
38static inline void get_mnt_ns(struct mnt_namespace *ns)
39{
40 atomic_inc(&ns->count);
41}
42
Miklos Szeredia1a2c402008-03-27 13:06:24 +010043extern const struct seq_operations mounts_op;
Ram Pai2d4d4862008-03-27 13:06:25 +010044extern const struct seq_operations mountinfo_op;
Miklos Szeredia1a2c402008-03-27 13:06:24 +010045extern const struct seq_operations mountstats_op;
46
Kirill Korotaev6b3286e2006-12-08 02:37:56 -080047#endif
48#endif