--- linux-2.6.13-vs2.0.1/fs/namespace.c 2005-08-29 22:42:13 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/namespace.c 2005-09-14 03:45:15 +0200 @@ -249,24 +249,26 @@ static int show_vfsmnt(struct seq_file * 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 } + { MS_RDONLY, MNT_RDONLY, "ro", "rw" }, + { MS_SYNCHRONOUS, 0, ",sync", NULL }, + { MS_DIRSYNC, 0, ",dirsync", NULL }, + { MS_MANDLOCK, 0, ",mand", NULL }, + { MS_TAGXID, 0, ",tagxid", NULL }, + { MS_NOATIME, MNT_NOATIME, ",noatime", NULL }, + { MS_NODIRATIME, MNT_NODIRATIME, ",nodiratime", NULL }, + { 0, MNT_NOSUID, ",nosuid", NULL }, + { 0, MNT_NODEV, ",nodev", NULL }, + { 0, MNT_NOEXEC, ",noexec", NULL }, + { 0, 0, NULL, NULL } }; - static struct proc_fs_info mnt_info[] = { - { MNT_NOSUID, ",nosuid" }, - { MNT_NODEV, ",nodev" }, - { MNT_NOEXEC, ",noexec" }, - { 0, 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; --- linux-2.6.13-vs2.0.1/fs/namespace.c 2005-08-29 22:42:13 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/namespace.c 2005-09-14 03:45:15 +0200 @@ -283,14 +285,15 @@ static int show_vfsmnt(struct seq_file * 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); --- linux-2.6.13-vs2.0.1/fs/namespace.c 2005-08-29 22:42:13 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/namespace.c 2005-09-14 03:45:15 +0200 @@ -684,7 +687,8 @@ out_unlock: /* * do loopback mount. */ -static int do_loopback(struct nameidata *nd, char *old_name, xid_t xid, int flags) +static int do_loopback(struct nameidata *nd, char *old_name, xid_t xid, + unsigned long flags, int mnt_flags) { struct nameidata old_nd; struct vfsmount *mnt = NULL; --- linux-2.6.13-vs2.0.1/fs/namespace.c 2005-08-29 22:42:13 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/namespace.c 2005-09-14 03:45:15 +0200 @@ -725,6 +729,7 @@ static int do_loopback(struct nameidata spin_unlock(&vfsmount_lock); } else mntput(mnt); + mnt->mnt_flags = mnt_flags; } up_write(¤t->namespace->sem); --- linux-2.6.13-vs2.0.1/fs/namespace.c 2005-08-29 22:42:13 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/namespace.c 2005-09-14 03:45:15 +0200 @@ -1119,12 +1124,18 @@ long do_mount(char * dev_name, char * di } /* 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) mnt_flags |= MNT_NODEV; if (flags & MS_NOEXEC) mnt_flags |= MNT_NOEXEC; + if (flags & MS_NOATIME) + mnt_flags |= MNT_NOATIME; + if (flags & MS_NODIRATIME) + mnt_flags |= MNT_NODIRATIME; flags &= ~(MS_NOSUID|MS_NOEXEC|MS_NODEV|MS_ACTIVE); if (vx_ccaps(VXC_SECURE_MOUNT)) --- linux-2.6.13-vs2.0.1/fs/namespace.c 2005-08-29 22:42:13 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/fs/namespace.c 2005-09-14 03:45:15 +0200 @@ -1143,7 +1154,7 @@ long do_mount(char * dev_name, char * di retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags, data_page, xid); else if (flags & MS_BIND) - retval = do_loopback(&nd, dev_name, xid, flags); + retval = do_loopback(&nd, dev_name, xid, flags, mnt_flags); else if (flags & MS_MOVE) retval = do_move_mount(&nd, dev_name); else --- linux-2.6.13-vs2.0.1/include/linux/fs.h 2005-08-29 22:42:14 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/include/linux/fs.h 2005-09-14 03:39:57 +0200 @@ -9,6 +9,7 @@ #include #include #include +#include /* * It's silly to have NR_OPEN bigger than NR_FILE, but you can change --- linux-2.6.13-vs2.0.1/include/linux/fs.h 2005-08-29 22:42:14 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/include/linux/fs.h 2005-09-14 03:39:57 +0200 @@ -150,7 +151,7 @@ extern int dir_notify_enable; */ #define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg)) -#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY) +#define IS_RDONLY(inode) __IS_FLG(inode, MS_RDONLY) #define IS_SYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS) || \ ((inode)->i_flags & S_SYNC)) #define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \ --- linux-2.6.13-vs2.0.1/include/linux/mount.h 2005-08-29 22:42:14 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/include/linux/mount.h 2005-09-14 03:45:15 +0200 @@ -20,6 +20,9 @@ #define MNT_NOSUID 1 #define MNT_NODEV 2 #define MNT_NOEXEC 4 +#define MNT_RDONLY 8 +#define MNT_NOATIME 16 +#define MNT_NODIRATIME 32 #define MNT_XID 256 struct vfsmount --- linux-2.6.13-vs2.0.1/include/linux/mount.h 2005-08-29 22:42:14 +0200 +++ linux-2.6.13-vs2.0.1-bme0.06.1/include/linux/mount.h 2005-09-14 03:45:15 +0200 @@ -41,6 +44,10 @@ struct vfsmount xid_t mnt_xid; /* xid tagging used for vfsmount */ }; +#define MNT_IS_RDONLY(m) ((m) && ((m)->mnt_flags & MNT_RDONLY)) +#define MNT_IS_NOATIME(m) ((m) && ((m)->mnt_flags & MNT_NOATIME)) +#define MNT_IS_NODIRATIME(m) ((m) && ((m)->mnt_flags & MNT_NODIRATIME)) + static inline struct vfsmount *mntget(struct vfsmount *mnt) { if (mnt)