INIT_LIST_HEAD(&p->mnt_hash);
INIT_LIST_HEAD(&p->mnt_child);
INIT_LIST_HEAD(&p->mnt_mounts);
- INIT_LIST_HEAD(&mnt->mnt_list);
+ INIT_LIST_HEAD(&p->mnt_list);
INIT_LIST_HEAD(&p->mnt_expire);
INIT_LIST_HEAD(&p->mnt_share);
INIT_LIST_HEAD(&p->mnt_slave_list);
BUG_ON(parent == mnt);
- list_add_tail(&head, &mnt->mnt.mnt_list);
- list_for_each_entry(m, &head, mnt.mnt_list) {
+ list_add_tail(&head, &mnt->mnt_list);
+ list_for_each_entry(m, &head, mnt_list) {
m->mnt_ns = n;
__mnt_make_longterm(m);
}
static int show_vfsmnt(struct seq_file *m, void *v)
{
- struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list);
+ struct mount *r = list_entry(v, struct mount, mnt_list);
+ struct vfsmount *mnt = &r->mnt;
int err = 0;
struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
static int show_mountinfo(struct seq_file *m, void *v)
{
struct proc_mounts *p = m->private;
- struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list);
- struct mount *r = real_mount(mnt);
+ struct mount *r = list_entry(v, struct mount, mnt_list);
+ struct vfsmount *mnt = &r->mnt;
struct super_block *sb = mnt->mnt_sb;
struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
struct path root = p->root;
static int show_vfsstat(struct seq_file *m, void *v)
{
- struct vfsmount *mnt = list_entry(v, struct vfsmount, mnt_list);
+ struct mount *r = list_entry(v, struct mount, mnt_list);
+ struct vfsmount *mnt = &r->mnt;
struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
int err = 0;
list_for_each_entry(p, &tmp_list, mnt_hash) {
list_del_init(&p->mnt_expire);
- list_del_init(&p->mnt.mnt_list);
+ list_del_init(&p->mnt_list);
__touch_mnt_namespace(p->mnt_ns);
p->mnt_ns = NULL;
__mnt_make_shortterm(p);
retval = -EBUSY;
if (flags & MNT_DETACH || !propagate_mount_busy(mnt, 2)) {
- if (!list_empty(&mnt->mnt.mnt_list))
+ if (!list_empty(&mnt->mnt_list))
umount_tree(mnt, 1, &umount_list);
retval = 0;
}
if (!q)
goto Enomem;
br_write_lock(vfsmount_lock);
- list_add_tail(&q->mnt.mnt_list, &res->mnt.mnt_list);
+ list_add_tail(&q->mnt_list, &res->mnt_list);
attach_mnt(q, &path);
br_write_unlock(vfsmount_lock);
}
int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
struct vfsmount *root)
{
- struct vfsmount *mnt;
+ struct mount *mnt;
int res = f(root, arg);
if (res)
return res;
- list_for_each_entry(mnt, &root->mnt_list, mnt_list) {
- res = f(mnt, arg);
+ list_for_each_entry(mnt, &real_mount(root)->mnt_list, mnt_list) {
+ res = f(&mnt->mnt, arg);
if (res)
return res;
}
}
new_ns->root = &new->mnt;
br_write_lock(vfsmount_lock);
- list_add_tail(&new_ns->list, &new_ns->root->mnt_list);
+ list_add_tail(&new_ns->list, &new->mnt_list);
br_write_unlock(vfsmount_lock);
/*
* create_mnt_ns - creates a private namespace and adds a root filesystem
* @mnt: pointer to the new root filesystem mountpoint
*/
-static struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt)
+static struct mnt_namespace *create_mnt_ns(struct vfsmount *m)
{
- struct mnt_namespace *new_ns;
-
- new_ns = alloc_mnt_ns();
+ struct mnt_namespace *new_ns = alloc_mnt_ns();
if (!IS_ERR(new_ns)) {
- real_mount(mnt)->mnt_ns = new_ns;
- __mnt_make_longterm(real_mount(mnt));
- new_ns->root = mnt;
- list_add(&new_ns->list, &new_ns->root->mnt_list);
+ struct mount *mnt = real_mount(m);
+ mnt->mnt_ns = new_ns;
+ __mnt_make_longterm(mnt);
+ new_ns->root = m;
+ list_add(&new_ns->list, &mnt->mnt_list);
} else {
- mntput(mnt);
+ mntput(m);
}
return new_ns;
}