- sync fedora branch: will help future merges
authorMark Huang <mlhuang@cs.princeton.edu>
Sat, 20 Aug 2005 18:28:59 +0000 (18:28 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Sat, 20 Aug 2005 18:28:59 +0000 (18:28 +0000)
- re-apply partially dropped bind mount patch (this time from
  patch-2.6.11-rc5-bme0.06.1.diff)

fs/namespace.c

index 9bfe604..e3dc070 100644 (file)
@@ -224,8 +224,6 @@ static int mnt_is_reachable(struct vfsmount *mnt)
        struct dentry *root, *point;
        int ret;
 
-       if (!mnt)
-               return 1;
        if (mnt == mnt->mnt_namespace->root)
                return 1;
 
@@ -251,25 +249,26 @@ static int show_vfsmnt(struct seq_file *m, void *v)
        struct vfsmount *mnt = v;
        int err = 0;
        static struct proc_fs_info {
-               int flag;
-               char *str;
+               int s_flag;
+               int mnt_flag;
+               char *set_str;
+               char *unset_str;
        } fs_info[] = {
-               { MS_SYNCHRONOUS, ",sync" },
-               { MS_DIRSYNC, ",dirsync" },
-               { MS_MANDLOCK, ",mand" },
-               { MS_NOATIME, ",noatime" },
-               { MS_NODIRATIME, ",nodiratime" },
-               { MS_TAGXID, ",tagxid" },
-               { 0, NULL }
-       };
-       static struct proc_fs_info mnt_info[] = {
-               { MNT_NOSUID, ",nosuid" },
-               { MNT_NODEV, ",nodev" },
-               { MNT_NOEXEC, ",noexec" },
-               { 0, NULL }
+               { MS_RDONLY, MNT_RDONLY, "ro", "rw" },
+               { MS_SYNCHRONOUS, 0, ",sync", NULL },
+               { MS_DIRSYNC, 0, ",dirsync", NULL },
+               { MS_MANDLOCK, 0, ",mand", NULL },
+               { MS_NOATIME, MNT_NOATIME, ",noatime", NULL },
+               { MS_NODIRATIME, MNT_NODIRATIME, ",nodiratime", NULL },
+               { MS_TAGXID, MS_TAGXID, ",tagxid", NULL },
+               { 0, MNT_NOSUID, ",nosuid", NULL },
+               { 0, MNT_NODEV, ",nodev", NULL },
+               { 0, MNT_NOEXEC, ",noexec", NULL },
+               { 0, 0, NULL, NULL }
        };
-
-       struct proc_fs_info *fs_infop;
+       struct proc_fs_info *p;
+       unsigned long s_flags = mnt->mnt_sb->s_flags;
+       int mnt_flags = mnt->mnt_flags;
 
        if (vx_flags(VXF_HIDE_MOUNT, 0))
                return 0;
@@ -286,14 +285,15 @@ static int show_vfsmnt(struct seq_file *m, void *v)
                seq_putc(m, ' ');
        }
        mangle(m, mnt->mnt_sb->s_type->name);
-       seq_puts(m, mnt->mnt_sb->s_flags & MS_RDONLY ? " ro" : " rw");
-       for (fs_infop = fs_info; fs_infop->flag; fs_infop++) {
-               if (mnt->mnt_sb->s_flags & fs_infop->flag)
-                       seq_puts(m, fs_infop->str);
-       }
-       for (fs_infop = mnt_info; fs_infop->flag; fs_infop++) {
-               if (mnt->mnt_flags & fs_infop->flag)
-                       seq_puts(m, fs_infop->str);
+       seq_putc(m, ' ');
+       for (p = fs_info; (p->s_flag | p->mnt_flag) ; p++) {
+               if ((s_flags & p->s_flag) || (mnt_flags & p->mnt_flag)) {
+                       if (p->set_str)
+                               seq_puts(m, p->set_str);
+               } else {
+                       if (p->unset_str)
+                               seq_puts(m, p->unset_str);
+               }
        }
        if (mnt->mnt_flags & MNT_XID)
                seq_printf(m, ",xid=%d", mnt->mnt_xid);