vfs: Keep a list of mounts on a mount point
authorEric W. Biederman <ebiederman@twitter.com>
Mon, 23 Sep 2013 02:37:01 +0000 (19:37 -0700)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 9 Oct 2014 06:38:54 +0000 (02:38 -0400)
To spot any possible problems call BUG if a mountpoint
is put when it's list of mounts is not empty.

AV: use hlist instead of list_head

Reviewed-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Eric W. Biederman <ebiederman@twitter.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/mount.h
fs/namespace.c

index 8c6a2a6..68bb03e 100644 (file)
@@ -21,6 +21,7 @@ struct mnt_pcp {
 struct mountpoint {
        struct hlist_node m_hash;
        struct dentry *m_dentry;
+       struct hlist_head m_list;
        int m_count;
 };
 
@@ -51,6 +52,7 @@ struct mount {
        struct mount *mnt_master;       /* slave is on master->mnt_slave_list */
        struct mnt_namespace *mnt_ns;   /* containing namespace */
        struct mountpoint *mnt_mp;      /* where is it mounted */
+       struct hlist_node mnt_mp_list;  /* list mounts with the same mountpoint */
 #ifdef CONFIG_FSNOTIFY
        struct hlist_head mnt_fsnotify_marks;
        __u32 mnt_fsnotify_mask;
diff --cc fs/namespace.c
Simple merge