diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-11-25 00:07:16 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-03 22:57:08 -0500 |
commit | d10e8def07fc87488c396d2eff2c26c43bb541dd (patch) | |
tree | d0ad0d4c47838a096aafac353e206861cb6d62c1 | |
parent | 14cf1fa8f54353d9caf6174c1e4280c8c4dcfd7a (diff) | |
download | linux-d10e8def07fc87488c396d2eff2c26c43bb541dd.tar.bz2 |
vfs: take mnt_master to struct mount
make IS_MNT_SLAVE take struct mount * at the same time
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/mount.h | 2 | ||||
-rw-r--r-- | fs/namespace.c | 10 | ||||
-rw-r--r-- | fs/pnode.c | 26 | ||||
-rw-r--r-- | include/linux/mount.h | 1 |
4 files changed, 20 insertions, 19 deletions
diff --git a/fs/mount.h b/fs/mount.h index e4ecf59c9353..7071d8fa9307 100644 --- a/fs/mount.h +++ b/fs/mount.h @@ -19,6 +19,8 @@ struct mount { #endif struct list_head mnt_mounts; /* list of children, anchored here */ struct list_head mnt_child; /* and going through their mnt_child */ + /* yet to be moved - up to mnt_slave */ + struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */ }; static inline struct mount *real_mount(struct vfsmount *mnt) diff --git a/fs/namespace.c b/fs/namespace.c index ee42e671afdc..3439042fc9f2 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -715,14 +715,14 @@ static struct mount *clone_mnt(struct mount *old, struct dentry *root, 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); @@ -1051,8 +1051,8 @@ static int show_mountinfo(struct seq_file *m, void *v) /* 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) diff --git a/fs/pnode.c b/fs/pnode.c index 0e1de28b1b2e..3ac44d15fe58 100644 --- a/fs/pnode.c +++ b/fs/pnode.c @@ -55,7 +55,7 @@ int get_dominating_id(struct mount *mnt, const struct path *root) { 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; @@ -66,8 +66,8 @@ int get_dominating_id(struct mount *mnt, const struct path *root) 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 @@ -92,7 +92,7 @@ static int do_make_slave(struct mount *mnt) 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); @@ -101,12 +101,12 @@ static int do_make_slave(struct mount *mnt) 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; } @@ -123,7 +123,7 @@ void change_mnt_propagation(struct mount *mnt, int type) 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 @@ -149,9 +149,9 @@ static struct mount *propagation_next(struct mount *m, 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) @@ -179,11 +179,11 @@ static struct mount *get_source(struct mount *dest, 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) { diff --git a/include/linux/mount.h b/include/linux/mount.h index e9990254d4d0..2d5beb5e3a8c 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h @@ -62,7 +62,6 @@ struct vfsmount { struct list_head mnt_share; /* circular list of shared mounts */ struct list_head mnt_slave_list;/* list of slave mounts */ struct list_head mnt_slave; /* slave list entry */ - struct vfsmount *mnt_master; /* slave is on master->mnt_slave_list */ struct mnt_namespace *mnt_ns; /* containing namespace */ int mnt_id; /* mount identifier */ int mnt_group_id; /* peer group identifier */ |