aboutsummaryrefslogtreecommitdiffstats
path: root/fs/mount.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/mount.h')
-rw-r--r--fs/mount.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/mount.h b/fs/mount.h
index 4ef36d93e5a2..4f291f9de641 100644
--- a/fs/mount.h
+++ b/fs/mount.h
@@ -22,7 +22,6 @@ struct mount {
22 struct vfsmount mnt; 22 struct vfsmount mnt;
23#ifdef CONFIG_SMP 23#ifdef CONFIG_SMP
24 struct mnt_pcp __percpu *mnt_pcp; 24 struct mnt_pcp __percpu *mnt_pcp;
25 atomic_t mnt_longterm; /* how many of the refs are longterm */
26#else 25#else
27 int mnt_count; 26 int mnt_count;
28 int mnt_writers; 27 int mnt_writers;
@@ -49,6 +48,8 @@ struct mount {
49 int mnt_ghosts; 48 int mnt_ghosts;
50}; 49};
51 50
51#define MNT_NS_INTERNAL ERR_PTR(-EINVAL) /* distinct from any mnt_namespace */
52
52static inline struct mount *real_mount(struct vfsmount *mnt) 53static inline struct mount *real_mount(struct vfsmount *mnt)
53{ 54{
54 return container_of(mnt, struct mount, mnt); 55 return container_of(mnt, struct mount, mnt);
@@ -59,6 +60,12 @@ static inline int mnt_has_parent(struct mount *mnt)
59 return mnt != mnt->mnt_parent; 60 return mnt != mnt->mnt_parent;
60} 61}
61 62
63static inline int is_mounted(struct vfsmount *mnt)
64{
65 /* neither detached nor internal? */
66 return !IS_ERR_OR_NULL(real_mount(mnt));
67}
68
62extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int); 69extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
63 70
64static inline void get_mnt_ns(struct mnt_namespace *ns) 71static inline void get_mnt_ns(struct mnt_namespace *ns)
@@ -67,10 +74,12 @@ static inline void get_mnt_ns(struct mnt_namespace *ns)
67} 74}
68 75
69struct proc_mounts { 76struct proc_mounts {
70 struct seq_file m; /* must be the first element */ 77 struct seq_file m;
71 struct mnt_namespace *ns; 78 struct mnt_namespace *ns;
72 struct path root; 79 struct path root;
73 int (*show)(struct seq_file *, struct vfsmount *); 80 int (*show)(struct seq_file *, struct vfsmount *);
74}; 81};
75 82
83#define proc_mounts(p) (container_of((p), struct proc_mounts, m))
84
76extern const struct seq_operations mounts_op; 85extern const struct seq_operations mounts_op;