aboutsummaryrefslogtreecommitdiffstats
path: root/fs/mount.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-09 00:59:08 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 08:32:47 -0400
commitf7a99c5b7c8bd3d3f533c8b38274e33f3da9096e (patch)
tree5c326c0ddd1f40eacbe2fd7c888f26b089389f99 /fs/mount.h
parentd187663ef24cd3d033f0cbf2867e70b36a3a90b8 (diff)
get rid of ->mnt_longterm
it's enough to set ->mnt_ns of internal vfsmounts to something distinct from all struct mnt_namespace out there; then we can just use the check for ->mnt_ns != NULL in the fast path of mntput_no_expire() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/mount.h')
-rw-r--r--fs/mount.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/mount.h b/fs/mount.h
index 4ef36d93e5a2..05a2a1185efc 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)