16 static inline struct mount *next_peer(
struct mount *
p)
21 static inline struct mount *first_slave(
struct mount *
p)
26 static inline struct mount *next_slave(
struct mount *
p)
33 const struct path *root)
59 struct mount *
d = get_peer_under_root(m, mnt->
mnt_ns, root);
67 static int do_make_slave(
struct mount *mnt)
70 struct mount *slave_mnt;
77 while ((peer_mnt = next_peer(peer_mnt)) != mnt &&
78 peer_mnt->
mnt.mnt_root != mnt->
mnt.mnt_root) ;
80 if (peer_mnt == mnt) {
81 peer_mnt = next_peer(mnt);
98 list_splice(&mnt->mnt_slave_list, master->mnt_slave_list.
prev);
99 INIT_LIST_HEAD(&mnt->mnt_slave_list);
102 while (!list_empty(p)) {
104 struct mount, mnt_slave);
144 static struct mount *propagation_next(
struct mount *m,
149 return first_slave(m);
156 return (next == origin) ?
NULL :
next;
158 return next_slave(m);
175 struct mount *last_dest,
176 struct mount *last_src,
183 p_last_dest = last_dest;
184 p_last_src = last_src;
191 p_last_dest = next_peer(p_last_dest);
194 if (dest == p_last_dest) {
225 struct mount *prev_dest_mnt = dest_mnt;
226 struct mount *prev_src_mnt = source_mnt;
230 for (m = propagation_next(dest_mnt, dest_mnt);
m;
231 m = propagation_next(m, dest_mnt)) {
238 source = get_source(m, prev_dest_mnt, prev_src_mnt, &type);
242 ret = PTR_ERR(child);
243 list_splice(tree_list, tmp_list.
prev);
258 prev_src_mnt = child;
262 while (!list_empty(&tmp_list)) {
274 static inline int do_refcount_check(
struct mount *mnt,
int count)
277 return (mycount > count);
297 return do_refcount_check(mnt, refcnt);
304 if (!list_empty(&mnt->
mnt_mounts) || do_refcount_check(mnt, refcnt))
307 for (m = propagation_next(parent, parent);
m;
308 m = propagation_next(m, parent)) {
310 if (child && list_empty(&child->
mnt_mounts) &&
311 (ret = do_refcount_check(child, 1)))
321 static void __propagate_umount(
struct mount *mnt)
328 for (m = propagation_next(parent, parent);
m;
329 m = propagation_next(m, parent)) {
354 __propagate_umount(mnt);