summaryrefslogtreecommitdiff
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 16: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 {
struct vfsmount mnt;
#ifdef CONFIG_SMP
struct mnt_pcp __percpu *mnt_pcp;
- atomic_t mnt_longterm; /* how many of the refs are longterm */
#else
int mnt_count;
int mnt_writers;
@@ -49,6 +48,8 @@ struct mount {
int mnt_ghosts;
};
+#define MNT_NS_INTERNAL ERR_PTR(-EINVAL) /* distinct from any mnt_namespace */
+
static inline struct mount *real_mount(struct vfsmount *mnt)
{
return container_of(mnt, struct mount, mnt);
@@ -59,6 +60,12 @@ static inline int mnt_has_parent(struct mount *mnt)
return mnt != mnt->mnt_parent;
}
+static inline int is_mounted(struct vfsmount *mnt)
+{
+ /* neither detached nor internal? */
+ return !IS_ERR_OR_NULL(real_mount(mnt));
+}
+
extern struct mount *__lookup_mnt(struct vfsmount *, struct dentry *, int);
static inline void get_mnt_ns(struct mnt_namespace *ns)