*/
#include <linux/config.h>
-#include <linux/syscalls.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/smp_lock.h>
#include <linux/namei.h>
#include <linux/security.h>
#include <linux/mount.h>
+#include <linux/vs_base.h>
#include <linux/vserver/namespace.h>
-#include <linux/vserver/xid.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
return found;
}
+EXPORT_SYMBOL(lookup_mnt);
+
static inline int check_mnt(struct vfsmount *mnt)
{
return mnt->mnt_namespace == current->namespace;
mnt->mnt_mountpoint = mnt->mnt_root;
mnt->mnt_parent = mnt;
mnt->mnt_namespace = old->mnt_namespace;
- mnt->mnt_xid = old->mnt_xid;
/* stick the duplicate mount on the same expiry list
* as the original if that was on one */
unsigned long s_flags = mnt->mnt_sb->s_flags;
int mnt_flags = mnt->mnt_flags;
- if (vx_flags(VXF_HIDE_MOUNT, 0))
- return 0;
- if (!vx_check_vfsmount(current->vx_info, mnt))
- return 0;
-
if (vx_flags(VXF_HIDE_MOUNT, 0))
return 0;
if (!vx_check_vfsmount(current->vx_info, mnt))
seq_puts(m, p->unset_str);
}
}
- if (mnt->mnt_flags & MNT_XID)
- seq_printf(m, ",xid=%d", mnt->mnt_xid);
if (mnt->mnt_sb->s_op->show_options)
err = mnt->mnt_sb->s_op->show_options(m, mnt);
seq_puts(m, " 0 0\n");
EXPORT_SYMBOL(may_umount);
-static inline void __umount_list(struct list_head *kill)
+static inline void __umount_tree(struct vfsmount *mnt, struct list_head *kill)
{
- struct vfsmount *mnt;
-
while (!list_empty(kill)) {
mnt = list_entry(kill->next, struct vfsmount, mnt_list);
list_del_init(&mnt->mnt_list);
list_del(&p->mnt_list);
list_add(&p->mnt_list, &kill);
}
- __umount_list(&kill);
+ __umount_tree(mnt, &kill);
}
void umount_unused(struct vfsmount *mnt, struct fs_struct *fs)
list_del(&p->mnt_list);
list_add(&p->mnt_list, &kill);
}
- __umount_list(&kill);
+ __umount_tree(mnt, &kill);
}
static int do_umount(struct vfsmount *mnt, int flags)
down_write(&sb->s_umount);
if (!(sb->s_flags & MS_RDONLY)) {
lock_kernel();
- DQUOT_OFF(sb);
retval = do_remount_sb(sb, MS_RDONLY, NULL, 0);
unlock_kernel();
}
/*
* do loopback mount.
*/
-static int do_loopback(struct nameidata *nd, char *old_name, xid_t xid, unsigned long flags, int mnt_flags)
+static int do_loopback(struct nameidata *nd, char *old_name, unsigned long flags, int mnt_flags)
{
struct nameidata old_nd;
struct vfsmount *mnt = NULL;
list_del_init(&mnt->mnt_fslink);
spin_unlock(&vfsmount_lock);
- if (flags & MS_XID) {
- mnt->mnt_xid = xid;
- mnt->mnt_flags |= MNT_XID;
- }
err = graft_tree(mnt, nd);
if (err) {
spin_lock(&vfsmount_lock);
*/
static int do_remount(struct nameidata *nd, int flags, int mnt_flags,
- void *data, xid_t xid)
+ void *data)
{
int err;
struct super_block * sb = nd->mnt->mnt_sb;
mnt_flags |= MNT_NODEV;
down_write(&sb->s_umount);
err = do_remount_sb(sb, flags, data, 0);
- if (!err) {
+ if (!err)
nd->mnt->mnt_flags=mnt_flags;
- if (flags & MS_XID)
- nd->mnt->mnt_xid = xid;
- }
up_write(&sb->s_umount);
if (!err)
security_sb_post_remount(nd->mnt, flags, data);
struct nameidata nd;
int retval = 0;
int mnt_flags = 0;
- xid_t xid = 0;
/* Discard magic */
if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
if (data_page)
((char *)data_page)[PAGE_SIZE - 1] = 0;
- retval = vx_parse_xid(data_page, &xid, 1);
- if (retval) {
- mnt_flags |= MNT_XID;
- /* bind and re-mounts get xid flag */
- if (flags & (MS_BIND|MS_REMOUNT))
- flags |= MS_XID;
- }
-
/* Separate the per-mountpoint flags */
if (flags & MS_RDONLY)
mnt_flags |= MNT_RDONLY;
if (flags & MS_REMOUNT)
retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags,
- data_page, xid);
+ data_page);
else if (flags & MS_BIND)
- retval = do_loopback(&nd, dev_name, xid, flags, mnt_flags);
-
+ retval = do_loopback(&nd, dev_name, flags, mnt_flags);
else if (flags & MS_MOVE)
retval = do_move_mount(&nd, dev_name);
else
}
EXPORT_SYMBOL_GPL(set_fs_root);
-
/*
* Replace the fs->{pwdmnt,pwd} with {mnt,dentry}. Put the old values.
* It can block. Requires the big lock held.