struct vfsmount *mnt = v;
int err = 0;
- /* device */
- if (mnt->mnt_devname) {
- seq_puts(m, "device ");
- mangle(m, mnt->mnt_devname);
- } else
- seq_puts(m, "no device");
-
- /* mount point */
- seq_puts(m, " mounted on ");
- seq_path(m, mnt, mnt->mnt_root, " \t\n\\");
- seq_putc(m, ' ');
+ if (vx_flags(VXF_HIDE_MOUNT, 0))
+ return 0;
+ if (!mnt_is_reachable(mnt) && !vx_check(0, VX_WATCH))
+ return 0;
+
+ if (!vx_check(0, VX_ADMIN|VX_WATCH) &&
+ mnt == current->fs->rootmnt) {
+ seq_puts(m, "device /dev/root mounted on / ");
+ } else {
+ /* device */
+ if (mnt->mnt_devname) {
+ seq_puts(m, "device ");
+ mangle(m, mnt->mnt_devname);
+ } else
+ seq_puts(m, "no device");
+
+ /* mount point */
+ seq_puts(m, " mounted on ");
+ seq_path(m, mnt, mnt->mnt_root, " \t\n\\");
+ seq_putc(m, ' ');
+ }
/* file system type */
seq_puts(m, "with fstype ");
}
}
-static inline void __umount_list(struct vfsmount *mnt,
- int propagate, struct list_head *kill)
+void umount_tree(struct vfsmount *mnt, int propagate, struct list_head *kill)
{
struct vfsmount *p;
+ for (p = mnt; p; p = next_mnt(p, mnt)) {
+ list_del(&p->mnt_hash);
+ list_add(&p->mnt_hash, kill);
+ }
+
if (propagate)
propagate_umount(kill);
}
}
-void umount_tree(struct vfsmount *mnt, int propagate, struct list_head *kill)
-{
- struct vfsmount *p;
-
- for (p = mnt; p; p = next_mnt(p, mnt)) {
- list_del(&p->mnt_hash);
- list_add(&p->mnt_hash, kill);
- // p->mnt_namespace = NULL;
- }
- __umount_list(mnt, propagate, kill);
-}
-
-void umount_unused(struct vfsmount *mnt, struct fs_struct *fs)
-{
- struct vfsmount *p;
- LIST_HEAD(kill);
-
- for (p = mnt; p; p = next_mnt(p, mnt)) {
- if (p == fs->rootmnt || p == fs->pwdmnt)
- continue;
- list_del(&p->mnt_list);
- list_add(&p->mnt_list, &kill);
- p->mnt_namespace = NULL;
- }
- __umount_list(mnt, 0, &kill);
-}
-
static int do_umount(struct vfsmount *mnt, int flags)
{
struct super_block *sb = mnt->mnt_sb;
if (flags & MS_NODIRATIME)
mnt_flags |= MNT_NODIRATIME;
- if (vx_ccaps(VXC_SECURE_MOUNT))
+ if (!capable(CAP_SYS_ADMIN))
mnt_flags |= MNT_NODEV;
flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE |
MS_NOATIME | MS_NODIRATIME);