]> nv-tegra.nvidia Code Review - linux-3.10.git/blobdiff - fs/mount.h
coredump: remove redundant defines for dumpable states
[linux-3.10.git] / fs / mount.h
index 4ef36d93e5a241822e10c21f93dc72d7137d32ec..cd50079804003ece9325c5338089952f9fa0166b 100644 (file)
@@ -4,8 +4,11 @@
 
 struct mnt_namespace {
        atomic_t                count;
+       unsigned int            proc_inum;
        struct mount *  root;
        struct list_head        list;
+       struct user_namespace   *user_ns;
+       u64                     seq;    /* Sequence number to prevent loops */
        wait_queue_head_t poll;
        int event;
 };
@@ -22,7 +25,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 +51,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 +63,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)
@@ -67,10 +77,12 @@ static inline void get_mnt_ns(struct mnt_namespace *ns)
 }
 
 struct proc_mounts {
-       struct seq_file m; /* must be the first element */
+       struct seq_file m;
        struct mnt_namespace *ns;
        struct path root;
        int (*show)(struct seq_file *, struct vfsmount *);
 };
 
+#define proc_mounts(p) (container_of((p), struct proc_mounts, m))
+
 extern const struct seq_operations mounts_op;