Lines Matching refs:mount
213 static int mnt_alloc_id(struct mount *mnt) in mnt_alloc_id()
225 static void mnt_free_id(struct mount *mnt) in mnt_free_id()
233 static int mnt_alloc_group_id(struct mount *mnt) in mnt_alloc_group_id()
246 void mnt_release_group_id(struct mount *mnt) in mnt_release_group_id()
255 static inline void mnt_add_count(struct mount *mnt, int n) in mnt_add_count()
269 int mnt_get_count(struct mount *mnt) in mnt_get_count()
285 static struct mount *alloc_vfsmnt(const char *name) in alloc_vfsmnt()
287 struct mount *mnt = kmem_cache_zalloc(mnt_cache, GFP_KERNEL); in alloc_vfsmnt()
365 static inline void mnt_inc_writers(struct mount *mnt) in mnt_inc_writers()
374 static inline void mnt_dec_writers(struct mount *mnt) in mnt_dec_writers()
383 static unsigned int mnt_get_writers(struct mount *mnt) in mnt_get_writers()
433 struct mount *mnt = real_mount(m); in mnt_get_write_access()
607 static inline int mnt_hold_writers(struct mount *mnt) in mnt_hold_writers()
650 static inline void mnt_unhold_writers(struct mount *mnt) in mnt_unhold_writers()
662 static inline void mnt_del_instance(struct mount *m) in mnt_del_instance()
664 struct mount **p = m->mnt_pprev_for_sb; in mnt_del_instance()
665 struct mount *next = m->mnt_next_for_sb; in mnt_del_instance()
672 static inline void mnt_add_instance(struct mount *m, struct super_block *s) in mnt_add_instance()
674 struct mount *first = s->s_mounts; in mnt_add_instance()
683 static int mnt_make_readonly(struct mount *mnt) in mnt_make_readonly()
704 for (struct mount *m = sb->s_mounts; m; m = m->mnt_next_for_sb) { in sb_prepare_remount_readonly()
716 for (struct mount *m = sb->s_mounts; m; m = m->mnt_next_for_sb) { in sb_prepare_remount_readonly()
724 static void free_vfsmnt(struct mount *mnt) in free_vfsmnt()
736 free_vfsmnt(container_of(head, struct mount, mnt_rcu)); in delayed_free_vfsmnt()
742 struct mount *mnt; in __legitimize_mnt()
789 struct mount *__lookup_mnt(struct vfsmount *mnt, struct dentry *dentry) in __lookup_mnt()
792 struct mount *p; in __lookup_mnt()
809 struct mount *child_mnt; in lookup_mnt()
841 struct mount *mnt, *n; in __is_local_mountpoint()
855 struct mount *parent;
946 static inline int check_mnt(const struct mount *mnt) in check_mnt()
951 static inline bool check_anonymous_mnt(struct mount *mnt) in check_anonymous_mnt()
987 static void __umount_mnt(struct mount *mnt, struct list_head *shrink_list) in __umount_mnt()
990 struct mount *parent = mnt->mnt_parent; in __umount_mnt()
1006 static void umount_mnt(struct mount *mnt) in umount_mnt()
1014 void mnt_set_mountpoint(struct mount *mnt, in mnt_set_mountpoint()
1016 struct mount *child_mnt) in mnt_set_mountpoint()
1024 static void make_visible(struct mount *mnt) in make_visible()
1026 struct mount *parent = mnt->mnt_parent; in make_visible()
1050 static void attach_mnt(struct mount *mnt, struct mount *parent, in attach_mnt()
1057 void mnt_change_mountpoint(struct mount *parent, struct mountpoint *mp, struct mount *mnt) in mnt_change_mountpoint()
1070 static inline struct mount *node_to_mount(struct rb_node *node) in node_to_mount()
1072 return node ? rb_entry(node, struct mount, mnt_node) : NULL; in node_to_mount()
1075 static void mnt_add_to_ns(struct mnt_namespace *ns, struct mount *mnt) in mnt_add_to_ns()
1104 static struct mount *next_mnt(struct mount *p, struct mount *root) in next_mnt()
1117 return list_entry(next, struct mount, mnt_child); in next_mnt()
1120 static struct mount *skip_mnt_tree(struct mount *p) in skip_mnt_tree()
1124 p = list_entry(prev, struct mount, mnt_child); in skip_mnt_tree()
1133 static void commit_tree(struct mount *mnt) in commit_tree()
1138 for (struct mount *m = mnt; m; m = next_mnt(m, mnt)) in commit_tree()
1148 static void setup_mnt(struct mount *m, struct dentry *root) in setup_mnt()
1173 struct mount *mnt; in vfs_create_mount()
1240 static struct mount *clone_mnt(struct mount *old, struct dentry *root, in clone_mnt()
1243 struct mount *mnt; in clone_mnt()
1292 static void cleanup_mnt(struct mount *mnt) in cleanup_mnt()
1295 struct mount *m; in cleanup_mnt()
1319 cleanup_mnt(container_of(head, struct mount, mnt_rcu)); in __cleanup_mnt()
1326 struct mount *m, *t; in delayed_mntput()
1333 static void noinline mntput_no_expire_slowpath(struct mount *mnt) in mntput_no_expire_slowpath()
1366 struct mount *p, *tmp; in mntput_no_expire_slowpath()
1389 static void mntput_no_expire(struct mount *mnt) in mntput_no_expire()
1412 struct mount *m = real_mount(mnt); in mntput()
1472 struct mount *p; in mnt_clone_internal()
1484 static struct mount *mnt_find_id_at(struct mnt_namespace *ns, u64 mnt_id) in mnt_find_id_at()
1487 struct mount *ret = NULL; in mnt_find_id_at()
1490 struct mount *m = node_to_mount(node); in mnt_find_id_at()
1508 static struct mount *mnt_find_id_at_reverse(struct mnt_namespace *ns, u64 mnt_id) in mnt_find_id_at_reverse()
1511 struct mount *ret = NULL; in mnt_find_id_at_reverse()
1514 struct mount *m = node_to_mount(node); in mnt_find_id_at_reverse()
1542 struct mount *next = NULL, *mnt = v; in m_next()
1561 struct mount *r = v; in m_show()
1584 struct mount *mnt = real_mount(m); in may_umount_tree()
1589 for (struct mount *p = mnt; p; p = next_mnt(p, mnt)) { in may_umount_tree()
1630 static void mnt_notify(struct mount *p) in mnt_notify()
1647 struct mount *m, *tmp; in notify_mnt_list()
1678 struct mount *m; in namespace_unlock()
1728 static bool disconnect_mount(struct mount *mnt, enum umount_tree_flags how) in disconnect_mount()
1761 static void umount_tree(struct mount *mnt, enum umount_tree_flags how) in umount_tree()
1764 struct mount *p; in umount_tree()
1791 p = list_first_entry(&tmp_list, struct mount, mnt_list); in umount_tree()
1830 static void shrink_submounts(struct mount *mnt);
1855 static int do_umount(struct mount *mnt, int flags) in do_umount()
1969 struct mount *mnt; in __detach_mounts()
1979 mnt = hlist_entry(mp.node.next, struct mount, mnt_mp_list); in __detach_mounts()
2008 struct mount *mnt = real_mount(path->mnt); in can_umount()
2027 struct mount *mnt = real_mount(path->mnt); in path_umount()
2147 struct mount *copy_tree(struct mount *src_root, struct dentry *dentry, in copy_tree()
2150 struct mount *res, *src_parent, *src_root_child, *src_mnt, in copy_tree()
2241 struct mount *root = real_mount(path->mnt); in collect_paths()
2242 struct mount *child; in collect_paths()
2256 for (struct mount *m = child; m; m = next_mnt(m, child)) { in collect_paths()
2284 struct mount *m = real_mount(mnt); in dissolve_on_fput()
2313 static bool __has_locked_children(struct mount *mnt, struct dentry *dentry) in __has_locked_children()
2315 struct mount *child; in __has_locked_children()
2327 bool has_locked_children(struct mount *mnt, struct dentry *dentry) in has_locked_children()
2341 static bool check_for_nsfs_mounts(struct mount *subtree) in check_for_nsfs_mounts()
2343 for (struct mount *p = subtree; p; p = next_mnt(p, subtree)) in check_for_nsfs_mounts()
2363 struct mount *old_mnt = real_mount(path->mnt); in clone_private_mount()
2364 struct mount *new_mnt; in clone_private_mount()
2402 static void lock_mnt_tree(struct mount *mnt) in lock_mnt_tree()
2404 struct mount *p; in lock_mnt_tree()
2429 static void cleanup_group_ids(struct mount *mnt, struct mount *end) in cleanup_group_ids()
2431 struct mount *p; in cleanup_group_ids()
2439 static int invent_group_ids(struct mount *mnt, bool recurse) in invent_group_ids()
2441 struct mount *p; in invent_group_ids()
2456 int count_mounts(struct mnt_namespace *ns, struct mount *mnt) in count_mounts()
2460 struct mount *p; in count_mounts()
2549 static int attach_recursive_mnt(struct mount *source_mnt, in attach_recursive_mnt()
2553 struct mount *dest_mnt = dest->parent; in attach_recursive_mnt()
2559 struct mount *child, *p; in attach_recursive_mnt()
2560 struct mount *top; in attach_recursive_mnt()
2625 struct mount *q; in attach_recursive_mnt()
2634 struct mount *r = topmost_overmount(child); in attach_recursive_mnt()
2649 child = hlist_entry(tree_list.first, struct mount, mnt_hash); in attach_recursive_mnt()
2665 static inline struct mount *where_to_mount(const struct path *path, in where_to_mount()
2669 struct mount *m; in where_to_mount()
2730 struct mount *m, *n; in do_lock_mount()
2804 static int graft_tree(struct mount *mnt, const struct pinned_mountpoint *mp) in graft_tree()
2816 static int may_change_propagation(const struct mount *m) in may_change_propagation()
2851 struct mount *m; in do_change_type()
2852 struct mount *mnt = real_mount(path->mnt); in do_change_type()
2927 struct mount *mnt = real_mount(path->mnt); in may_copy_tree()
2946 static struct mount *__do_loopback(const struct path *old_path, in __do_loopback()
2949 struct mount *old = real_mount(old_path->mnt); in __do_loopback()
2986 struct mount *mnt = NULL; in do_loopback()
3023 struct mount *mnt, *p; in get_detached_copy()
3085 struct mount *new_ns_root; in create_new_namespace()
3086 struct mount *mnt; in create_new_namespace()
3154 for (struct mount *p = new_ns_root; p; p = next_mnt(p, new_ns_root)) { in create_new_namespace()
3236 static bool can_change_locked_flags(struct mount *mnt, unsigned int mnt_flags) in can_change_locked_flags()
3263 static int change_mount_ro_state(struct mount *mnt, unsigned int mnt_flags) in change_mount_ro_state()
3277 static void set_mount_attributes(struct mount *mnt, unsigned int mnt_flags) in set_mount_attributes()
3322 struct mount *mnt = real_mount(path->mnt); in do_reconfigure_mnt()
3361 struct mount *mnt = real_mount(path->mnt); in do_remount()
3404 static inline int tree_contains_unbindable(struct mount *mnt) in tree_contains_unbindable()
3406 struct mount *p; in tree_contains_unbindable()
3416 struct mount *from = real_mount(from_path->mnt); in do_set_group()
3417 struct mount *to = real_mount(to_path->mnt); in do_set_group()
3500 static bool mount_is_ancestor(const struct mount *p1, const struct mount *p2) in mount_is_ancestor()
3526 static int can_move_mount_beneath(const struct mount *mnt_from, in can_move_mount_beneath()
3527 const struct mount *mnt_to, in can_move_mount_beneath()
3530 struct mount *parent_mnt_to = mnt_to->mnt_parent; in can_move_mount_beneath()
3611 static inline bool may_use_mount(struct mount *mnt) in may_use_mount()
3631 struct mount *old = real_mount(old_path->mnt); in do_move_mount()
3678 struct mount *over = real_mount(new_path->mnt); in do_move_mount()
3719 static int do_add_mount(struct mount *newmnt, const struct pinned_mountpoint *mp, in do_add_mount()
3722 struct mount *parent = mp->parent; in do_add_mount()
3868 struct mount *mnt; in finish_automount()
3915 struct mount *mnt, *next; in mark_mounts_for_expiry()
3940 mnt = list_first_entry(&graveyard, struct mount, mnt_expire); in mark_mounts_for_expiry()
3954 static int select_submounts(struct mount *parent, struct list_head *graveyard) in select_submounts()
3956 struct mount *this_parent = parent; in select_submounts()
3965 struct mount *mnt = list_entry(tmp, struct mount, mnt_child); in select_submounts()
4000 static void shrink_submounts(struct mount *mnt) in shrink_submounts()
4003 struct mount *m; in shrink_submounts()
4008 m = list_first_entry(&graveyard, struct mount, in shrink_submounts()
4223 struct mount *p, *q; in copy_mnt_ns()
4224 struct mount *old; in copy_mnt_ns()
4225 struct mount *new; in copy_mnt_ns()
4291 struct mount *mnt = real_mount(m); in mount_subtree()
4325 SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name, in SYSCALL_DEFINE5() argument
4400 struct mount *mnt; in SYSCALL_DEFINE3()
4600 bool is_path_reachable(struct mount *mnt, struct dentry *dentry, in is_path_reachable()
4620 struct mount *new_mnt, *root_mnt, *old_mnt, *root_parent, *ex_parent; in path_pivot_root()
4733 static unsigned int recalc_flags(struct mount_kattr *kattr, struct mount *mnt) in recalc_flags()
4745 static int can_idmap_mount(const struct mount_kattr *kattr, struct mount *mnt) in can_idmap_mount()
4796 const struct mount *mnt) in mnt_allow_writers()
4803 static int mount_setattr_prepare(struct mount_kattr *kattr, struct mount *mnt) in mount_setattr_prepare()
4805 struct mount *m; in mount_setattr_prepare()
4832 for (struct mount *p = mnt; p != m; p = next_mnt(p, mnt)) in mount_setattr_prepare()
4838 static void do_idmap_mount(const struct mount_kattr *kattr, struct mount *mnt) in do_idmap_mount()
4852 static void mount_setattr_commit(struct mount_kattr *kattr, struct mount *mnt) in mount_setattr_commit()
4854 struct mount *m; in mount_setattr_commit()
4876 struct mount *mnt = real_mount(path->mnt); in do_mount_setattr()
5176 struct mount *mnt = mnt_find_id_at(ns, id); in lookup_mnt_in_ns()
5228 static u64 mnt_to_propagation_flags(struct mount *m) in mnt_to_propagation_flags()
5263 struct mount *m = real_mount(s->mnt); in statmount_mnt_basic()
5278 struct mount *m = real_mount(s->mnt); in statmount_propagate_from()
5336 struct mount *r = real_mount(s->mnt); in statmount_sb_source()
5608 static struct mount *listmnt_next(struct mount *curr, bool reverse) in listmnt_next()
5622 struct mount *first, *child; in grab_requested_root()
5704 struct mount *m; in do_statmount()
5978 struct mount *r, *first; in do_listmount()
6127 struct mount *mnt_root; in init_mount_tree()
6171 for (struct mount *p = mnt_root; p; p = next_mnt(p, mnt_root)) { in init_mount_tree()
6192 mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct mount), in mnt_init()
6280 struct mount *root; in current_chrooted()
6298 struct mount *mnt, *n; in mnt_already_visible()
6302 struct mount *child; in mnt_already_visible()