if (flag & CL_SLAVE) {
list_add(&mnt->mnt.mnt_slave, &old->mnt.mnt_slave_list);
- mnt->mnt.mnt_master = &old->mnt;
+ mnt->mnt_master = &old->mnt;
CLEAR_MNT_SHARED(&mnt->mnt);
} else if (!(flag & CL_PRIVATE)) {
if ((flag & CL_MAKE_SHARED) || IS_MNT_SHARED(&old->mnt))
list_add(&mnt->mnt.mnt_share, &old->mnt.mnt_share);
- if (IS_MNT_SLAVE(&old->mnt))
+ if (IS_MNT_SLAVE(old))
list_add(&mnt->mnt.mnt_slave, &old->mnt.mnt_slave);
- mnt->mnt.mnt_master = old->mnt.mnt_master;
+ mnt->mnt_master = old->mnt_master;
}
if (flag & CL_MAKE_SHARED)
set_mnt_shared(mnt);
/* Tagged fields ("foo:X" or "bar") */
if (IS_MNT_SHARED(mnt))
seq_printf(m, " shared:%i", mnt->mnt_group_id);
- if (IS_MNT_SLAVE(mnt)) {
- int master = mnt->mnt_master->mnt_group_id;
+ if (IS_MNT_SLAVE(r)) {
+ int master = r->mnt_master->mnt_group_id;
int dom = get_dominating_id(r, &p->root);
seq_printf(m, " master:%i", master);
if (dom && dom != master)
{
struct mount *m;
- for (m = real_mount(mnt->mnt.mnt_master); m != NULL; m = real_mount(m->mnt.mnt_master)) {
+ for (m = real_mount(mnt->mnt_master); m != NULL; m = real_mount(m->mnt_master)) {
struct mount *d = get_peer_under_root(m, mnt->mnt.mnt_ns, root);
if (d)
return d->mnt.mnt_group_id;
static int do_make_slave(struct mount *mnt)
{
- struct mount *peer_mnt = mnt, *master = real_mount(mnt->mnt.mnt_master);
- struct vfsmount *slave_mnt;
+ struct mount *peer_mnt = mnt, *master = real_mount(mnt->mnt_master);
+ struct mount *slave_mnt;
/*
* slave 'mnt' to a peer mount that has the
master = peer_mnt;
if (master) {
- list_for_each_entry(slave_mnt, &mnt->mnt.mnt_slave_list, mnt_slave)
+ list_for_each_entry(slave_mnt, &mnt->mnt.mnt_slave_list, mnt.mnt_slave)
slave_mnt->mnt_master = &master->mnt;
list_move(&mnt->mnt.mnt_slave, &master->mnt.mnt_slave_list);
list_splice(&mnt->mnt.mnt_slave_list, master->mnt.mnt_slave_list.prev);
struct list_head *p = &mnt->mnt.mnt_slave_list;
while (!list_empty(p)) {
slave_mnt = list_first_entry(p,
- struct vfsmount, mnt_slave);
- list_del_init(&slave_mnt->mnt_slave);
+ struct mount, mnt.mnt_slave);
+ list_del_init(&slave_mnt->mnt.mnt_slave);
slave_mnt->mnt_master = NULL;
}
}
- mnt->mnt.mnt_master = &master->mnt;
+ mnt->mnt_master = &master->mnt;
CLEAR_MNT_SHARED(&mnt->mnt);
return 0;
}
do_make_slave(mnt);
if (type != MS_SLAVE) {
list_del_init(&mnt->mnt.mnt_slave);
- mnt->mnt.mnt_master = NULL;
+ mnt->mnt_master = NULL;
if (type == MS_UNBINDABLE)
mnt->mnt.mnt_flags |= MNT_UNBINDABLE;
else
return first_slave(m);
while (1) {
- struct mount *master = real_mount(m->mnt.mnt_master);
+ struct mount *master = real_mount(m->mnt_master);
- if (&master->mnt == origin->mnt.mnt_master) {
+ if (&master->mnt == origin->mnt_master) {
struct mount *next = next_peer(m);
return (next == origin) ? NULL : next;
} else if (m->mnt.mnt_slave.next != &master->mnt.mnt_slave_list)
struct mount *p_last_src = NULL;
struct mount *p_last_dest = NULL;
- while (&last_dest->mnt != dest->mnt.mnt_master) {
+ while (&last_dest->mnt != dest->mnt_master) {
p_last_dest = last_dest;
p_last_src = last_src;
- last_dest = real_mount(last_dest->mnt.mnt_master);
- last_src = real_mount(last_src->mnt.mnt_master);
+ last_dest = real_mount(last_dest->mnt_master);
+ last_src = real_mount(last_src->mnt_master);
}
if (p_last_dest) {