From: Herbert Pƶtzl <[EMAIL PROTECTED]>

Previously, it was down the the filesystem to know whether it is
mounted read-only, and was of no interest to the VFS.  We want
per-mount read-only.

Add an extra flag to the list of per-vfsmount flags for read-only, and
a macro to test it.  Also, make sure the new flag is put in the right
place to make it to do_loopback.  It is also by side effect passed to
do_remount and do_new_mount, it is of little discernable effect as the
underlying mount will be read-only.

Acked-by: Sam Vilain <[EMAIL PROTECTED]>
---

 fs/namespace.c        |    2 ++
 include/linux/mount.h |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index 1094e54..b12ea35 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1289,6 +1289,8 @@ long do_mount(char *dev_name, char *dir_
                ((char *)data_page)[PAGE_SIZE - 1] = 0;
 
        /* Separate the per-mountpoint flags */
+       if (flags & MS_RDONLY)
+               mnt_flags |= MNT_RDONLY;
        if (flags & MS_NOSUID)
                mnt_flags |= MNT_NOSUID;
        if (flags & MS_NODEV)
diff --git a/include/linux/mount.h b/include/linux/mount.h
index b7472ae..c485c2b 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -22,6 +22,9 @@
 #define MNT_NOEXEC     0x04
 #define MNT_NOATIME    0x08
 #define MNT_NODIRATIME 0x10
+#define MNT_RDONLY     0x20
+
+#define MNT_IS_RDONLY(m)       ((m) && ((m)->mnt_flags & MNT_RDONLY))
 
 #define MNT_SHARED     0x1000  /* if the vfsmount is a shared mount */
 #define MNT_UNBINDABLE 0x2000  /* if the vfsmount is a unbindable mount */

_______________________________________________
Vserver mailing list
[email protected]
http://list.linux-vserver.org/mailman/listinfo/vserver

Reply via email to