Lines Matching refs:mount
9 #include <linux/mount.h>
12 #include <uapi/linux/mount.h>
16 /* return the next shared peer mount of @p */
17 static inline struct mount *next_peer(struct mount *p)
19 return list_entry(p->mnt_share.next, struct mount, mnt_share);
22 static inline struct mount *first_slave(struct mount *p)
24 return list_entry(p->mnt_slave_list.next, struct mount, mnt_slave);
27 static inline struct mount *last_slave(struct mount *p)
29 return list_entry(p->mnt_slave_list.prev, struct mount, mnt_slave);
32 static inline struct mount *next_slave(struct mount *p)
34 return list_entry(p->mnt_slave.next, struct mount, mnt_slave);
37 static struct mount *get_peer_under_root(struct mount *mnt,
41 struct mount *m = mnt;
60 int get_dominating_id(struct mount *mnt, const struct path *root)
62 struct mount *m;
65 struct mount *d = get_peer_under_root(m, mnt->mnt_ns, root);
73 static int do_make_slave(struct mount *mnt)
75 struct mount *master, *slave_mnt;
87 struct mount, mnt_slave);
94 struct mount *m;
96 * slave 'mnt' to a peer mount that has the
122 void change_mnt_propagation(struct mount *mnt, int type)
140 * get the next mount in the propagation tree.
141 * @m: the mount seen last
142 * @origin: the original mount from where the tree walk initiated
149 static struct mount *propagation_next(struct mount *m,
150 struct mount *origin)
152 /* are there any slaves of this mount? */
157 struct mount *master = m->mnt_master;
160 struct mount *next = next_peer(m);
170 static struct mount *skip_propagation_subtree(struct mount *m,
171 struct mount *origin)
183 static struct mount *next_group(struct mount *m, struct mount *origin)
187 struct mount *next;
200 struct mount *master = m->mnt_master;
216 static struct mount *last_dest, *first_source, *last_source, *dest_master;
219 static inline bool peers(const struct mount *m1, const struct mount *m2)
224 static int propagate_one(struct mount *m, struct mountpoint *dest_mp)
226 struct mount *child;
237 struct mount *n, *p;
245 struct mount *parent = last_source->mnt_parent;
275 * mount 'source_mnt' under the destination 'dest_mnt' at
276 * dentry 'dest_dentry'. And propagate that mount to
282 * @dest_mnt: destination mount.
284 * @source_mnt: source mount.
287 int propagate_mnt(struct mount *dest_mnt, struct mountpoint *dest_mp,
288 struct mount *source_mnt, struct hlist_head *tree_list)
290 struct mount *m, *n;
334 static struct mount *find_topper(struct mount *mnt)
336 /* If there is exactly one mount covering mnt completely return it. */
337 struct mount *child;
342 child = list_first_entry(&mnt->mnt_mounts, struct mount, mnt_child);
352 static inline int do_refcount_check(struct mount *mnt, int count)
360 * @from: shared mount
361 * @to: mount to check
368 * If the root of the @to mount is equal to the future mountpoint @mp of
369 * the @to mount on @from then @to will be overmounted by whatever is
376 bool propagation_would_overmount(const struct mount *from,
377 const struct mount *to,
389 for (const struct mount *m = to; m; m = m->mnt_master) {
398 * check if the mount 'mnt' can be unmounted successfully.
399 * @mnt: the mount to be checked for unmount
407 int propagate_mount_busy(struct mount *mnt, int refcnt)
409 struct mount *m, *child, *topper;
410 struct mount *parent = mnt->mnt_parent;
416 * quickly check if the current mount can be unmounted.
430 /* Is there exactly one mount on the child that covers
450 void propagate_mount_unlock(struct mount *mnt)
452 struct mount *parent = mnt->mnt_parent;
453 struct mount *m, *child;
465 static void umount_one(struct mount *mnt, struct list_head *to_umount)
478 static bool __propagate_umount(struct mount *mnt,
483 struct mount *child;
486 * The state of the parent won't change if this mount is
508 /* If a mount is without children and not locked umount it. */
522 struct mount *mnt, *child, *tmp;
538 struct mount *mnt, *parent;
541 mnt = list_first_entry(to_restore, struct mount, mnt_umounting);
545 /* Should this mount be reparented? */
560 struct mount *mnt =
561 list_first_entry(visited, struct mount, mnt_umounting);
567 * collect all mounts that receive propagation from the mount in @list,
575 struct mount *mnt;
582 struct mount *parent = mnt->mnt_parent;
583 struct mount *m;
586 * If this mount has already been visited it is known that it's
597 struct mount *child = __lookup_mnt(&m->mnt,
615 * mount in list that has not been visited yet.