Lines Matching full:mount

31 #include <uapi/linux/mount.h>
40 /* Maximum number of mounts in a mount namespace */
72 /* Don't allow confusion with old 32bit mount ID */
146 /* keep alive for {list,stat}mount() */ in mnt_ns_release()
156 /* remove from global mount namespace list */ in DEFINE_FREE()
166 * Returns the mount namespace which either has the specified id, or has the
192 * Lookup a mount namespace by id and take a passive reference count. Taking a
193 * passive reference means the mount namespace can be emptied if e.g., the last
196 * already shut down before acquiring @namespace_sem, {list,stat}mount() will
197 * see that the mount rbtree of the namespace is empty.
237 static int mnt_alloc_id(struct mount *mnt) in mnt_alloc_id()
248 static void mnt_free_id(struct mount *mnt) in mnt_free_id()
256 static int mnt_alloc_group_id(struct mount *mnt) in mnt_alloc_group_id()
269 void mnt_release_group_id(struct mount *mnt) in mnt_release_group_id()
278 static inline void mnt_add_count(struct mount *mnt, int n) in mnt_add_count()
292 int mnt_get_count(struct mount *mnt) in mnt_get_count()
308 static struct mount *alloc_vfsmnt(const char *name) in alloc_vfsmnt()
310 struct mount *mnt = kmem_cache_zalloc(mnt_cache, GFP_KERNEL); in alloc_vfsmnt()
371 * __mnt_is_readonly: check whether a mount is read-only
372 * @mnt: the mount to check for its write status
387 static inline void mnt_inc_writers(struct mount *mnt) in mnt_inc_writers()
396 static inline void mnt_dec_writers(struct mount *mnt) in mnt_dec_writers()
405 static unsigned int mnt_get_writers(struct mount *mnt) in mnt_get_writers()
428 * not see any superblock / mount flag changes done by remount. in mnt_is_readonly()
431 * see the values of superblock / mount flags updated by remount. in mnt_is_readonly()
444 * mnt_get_write_access - get write access to a mount without freeze protection
445 * @m: the mount on which to take a write
455 struct mount *mnt = real_mount(m); in mnt_get_write_access()
503 * mnt_want_write - get write access to a mount
504 * @m: the mount on which to take a write
507 * it, and makes sure that writes are allowed (mount is read-write, filesystem
524 * mnt_get_write_access_file - get write access to a file's mount
525 * @file: the file who's mount on which to take a write
547 * mnt_want_write_file - get write access to a file's mount
548 * @file: the file who's mount on which to take a write
568 * mnt_put_write_access - give up write access to a mount
569 * @mnt: the mount on which to give up write access
584 * mnt_drop_write - give up write access to a mount
585 * @mnt: the mount on which to give up write access
612 * mnt_hold_writers - prevent write access to the given mount
629 static inline int mnt_hold_writers(struct mount *mnt) in mnt_hold_writers()
661 * mnt_unhold_writers - stop preventing write access to the given mount
672 static inline void mnt_unhold_writers(struct mount *mnt) in mnt_unhold_writers()
682 static int mnt_make_readonly(struct mount *mnt) in mnt_make_readonly()
695 struct mount *mnt; 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()
782 * __lookup_mnt - find first child mount
783 * @mnt: parent mount
786 * If @mnt has a child mount @c mounted @dentry find and return it.
788 * Note that the child mount @c need not be unique. There are cases
789 * where shadow mounts are created. For example, during mount
790 * propagation when a source mount @mnt whose root got overmounted by a
791 * mount @o after path lookup but before @namespace_sem could be
793 * @o. When @mnt is propagated to a destination mount @d that already
794 * has another mount @n mounted at the same mountpoint then the source
795 * mount @mnt will be tucked beneath @n, i.e., @n will be mounted on
801 struct mount *__lookup_mnt(struct vfsmount *mnt, struct dentry *dentry) in __lookup_mnt()
804 struct mount *p; in __lookup_mnt()
813 * lookup_mnt - Return the first child mount mounted at path
818 * mount /dev/sda1 /mnt
819 * mount /dev/sda2 /mnt
820 * mount /dev/sda3 /mnt
822 * Then lookup_mnt() on the base /mnt dentry in the root mount will
830 struct mount *child_mnt; in lookup_mnt()
846 * current mount namespace.
851 * mounts in the current mount namespace and test to see if the dentry
855 * need to identify all mounts that may be in the current mount
856 * namespace not just a mount that happens to have some specified
857 * parent mount.
862 struct mount *mnt, *n; in __is_local_mountpoint()
964 static inline int check_mnt(struct mount *mnt) in check_mnt()
994 static struct mountpoint *unhash_mnt(struct mount *mnt) in unhash_mnt()
1010 static void umount_mnt(struct mount *mnt) in umount_mnt()
1018 void mnt_set_mountpoint(struct mount *mnt, in mnt_set_mountpoint()
1020 struct mount *child_mnt) in mnt_set_mountpoint()
1031 * mnt_set_mountpoint_beneath - mount a mount beneath another one
1033 * @new_parent: the source mount
1034 * @top_mnt: the mount beneath which @new_parent is mounted
1038 * parent @top_mnt->mnt_parent and mount it on top of @new_parent at
1039 * @new_mp. And mount @new_parent on the old parent and old
1045 static void mnt_set_mountpoint_beneath(struct mount *new_parent, in mnt_set_mountpoint_beneath()
1046 struct mount *top_mnt, in mnt_set_mountpoint_beneath()
1049 struct mount *old_top_parent = top_mnt->mnt_parent; in mnt_set_mountpoint_beneath()
1057 static void __attach_mnt(struct mount *mnt, struct mount *parent) in __attach_mnt()
1065 * attach_mnt - mount a mount, attach to @mount_hashtable and parent's
1068 * @mnt: the new mount
1070 * @beneath: whether to mount @mnt beneath or on top of @parent
1072 * If @beneath is false, mount @mnt at @mp on @parent. Then attach @mnt
1073 * to @parent's child mount list and to @mount_hashtable.
1076 * mountpoint and mount it on @mp on @parent, and mount @parent on the
1086 static void attach_mnt(struct mount *mnt, struct mount *parent, in attach_mnt()
1097 * isn't the same mount as @parent. in attach_mnt()
1102 void mnt_change_mountpoint(struct mount *parent, struct mountpoint *mp, struct mount *mnt) in mnt_change_mountpoint()
1105 struct mount *old_parent = mnt->mnt_parent; in mnt_change_mountpoint()
1117 static inline struct mount *node_to_mount(struct rb_node *node) in node_to_mount()
1119 return node ? rb_entry(node, struct mount, mnt_node) : NULL; in node_to_mount()
1122 static void mnt_add_to_ns(struct mnt_namespace *ns, struct mount *mnt) in mnt_add_to_ns()
1144 static void commit_tree(struct mount *mnt) in commit_tree()
1146 struct mount *parent = mnt->mnt_parent; in commit_tree()
1147 struct mount *m; in commit_tree()
1167 static struct mount *next_mnt(struct mount *p, struct mount *root) in next_mnt()
1180 return list_entry(next, struct mount, mnt_child); in next_mnt()
1183 static struct mount *skip_mnt_tree(struct mount *p) in skip_mnt_tree()
1187 p = list_entry(prev, struct mount, mnt_child); in skip_mnt_tree()
1194 * vfs_create_mount - Create a mount for a configured superblock
1197 * Create a mount to an already configured superblock. If necessary, the
1200 * Note that this does not attach the mount to anything.
1204 struct mount *mnt; in vfs_create_mount()
1275 * through from the parent mount to the submount don't support in vfs_submount()
1285 static struct mount *clone_mnt(struct mount *old, struct dentry *root, in clone_mnt()
1289 struct mount *mnt; in clone_mnt()
1338 /* stick the duplicate mount on the same expiry list in clone_mnt()
1353 static void cleanup_mnt(struct mount *mnt) in cleanup_mnt()
1356 struct mount *m; in cleanup_mnt()
1380 cleanup_mnt(container_of(head, struct mount, mnt_rcu)); in __cleanup_mnt()
1387 struct mount *m, *t; in delayed_mntput()
1394 static void mntput_no_expire(struct mount *mnt) in mntput_no_expire()
1439 struct mount *p, *tmp; in mntput_no_expire()
1465 struct mount *m = real_mount(mnt); in mntput()
1483 * Make a mount point inaccessible to new lookups.
1485 * for an RCU grace period before destroying the mount point.
1494 * path_is_mountpoint() - Check if path is a mount in the current namespace.
1525 struct mount *p; in mnt_clone_internal()
1534 * Returns the mount which either has the specified mnt_id, or has the next
1537 static struct mount *mnt_find_id_at(struct mnt_namespace *ns, u64 mnt_id) in mnt_find_id_at()
1540 struct mount *ret = NULL; in mnt_find_id_at()
1543 struct mount *m = node_to_mount(node); in mnt_find_id_at()
1558 * Returns the mount which either has the specified mnt_id, or has the next
1561 static struct mount *mnt_find_id_at_reverse(struct mnt_namespace *ns, u64 mnt_id) in mnt_find_id_at_reverse()
1564 struct mount *ret = NULL; in mnt_find_id_at_reverse()
1567 struct mount *m = node_to_mount(node); in mnt_find_id_at_reverse()
1595 struct mount *next = NULL, *mnt = v; in m_next()
1614 struct mount *r = v; in m_show()
1628 * may_umount_tree - check if a mount tree is busy
1629 * @m: root of mount tree
1637 struct mount *mnt = real_mount(m); in may_umount_tree()
1640 struct mount *p; in may_umount_tree()
1660 * may_umount - check if a mount point is busy
1661 * @mnt: root of mount
1663 * This is called to check if a mount point has any
1665 * mount has sub mounts this will return busy
1690 struct mount *m; in namespace_unlock()
1722 static bool disconnect_mount(struct mount *mnt, enum umount_tree_flags how) in disconnect_mount()
1728 /* A mount without a parent has nothing to be connected to */ in disconnect_mount()
1739 /* Has it been requested that the mount remain connected? */ in disconnect_mount()
1743 /* Is the mount locked such that it needs to remain connected? */ in disconnect_mount()
1747 /* By default disconnect the mount */ in disconnect_mount()
1755 static void umount_tree(struct mount *mnt, enum umount_tree_flags how) in umount_tree()
1758 struct mount *p; in umount_tree()
1784 p = list_first_entry(&tmp_list, struct mount, mnt_list); in umount_tree()
1812 static void shrink_submounts(struct mount *mnt);
1837 static int do_umount(struct mount *mnt, int flags) in do_umount()
1874 * mount, and they will themselves hold resources we must in do_umount()
1878 * must return, and the like. Thats for the mount program to worry in do_umount()
1939 * to an existing mountpoint, and wind up leaking the mount.
1948 struct mount *mnt; in __detach_mounts()
1958 mnt = hlist_entry(mp->m_list.first, struct mount, mnt_mp_list); in __detach_mounts()
1982 "WARNING: The mand mount option has been deprecated and\n" in warn_mandlock()
1984 " option from the mount to silence this warning.\n" in warn_mandlock()
1990 struct mount *mnt = real_mount(path->mnt); in can_umount()
2008 struct mount *mnt = real_mount(path->mnt); in path_umount()
2058 /* Is this a proxy for a mount namespace? */ in is_mnt_ns_file()
2088 * Holding mnt_ns_tree_lock prevents the mount namespace from in __lookup_next_mnt_ns()
2091 * persisting the mount namespace. in __lookup_next_mnt_ns()
2102 /* Could bind mounting the mount namespace inode cause a in mnt_ns_loop()
2103 * mount namespace loop? in mnt_ns_loop()
2113 struct mount *copy_tree(struct mount *src_root, struct dentry *dentry, in copy_tree()
2116 struct mount *res, *src_parent, *src_root_child, *src_mnt, in copy_tree()
2185 struct mount *tree; in collect_mounts()
2228 bool has_locked_children(struct mount *mnt, struct dentry *dentry) in has_locked_children()
2230 struct mount *child; in has_locked_children()
2246 * This creates a new vfsmount, which will be the clone of @path. The new mount
2248 * changes to the originating mount won't be propagated into this).
2254 struct mount *old_mnt = real_mount(path->mnt); in clone_private_mount()
2255 struct mount *new_mnt; in clone_private_mount()
2273 /* Longterm mount to be removed by kern_unmount*() */ in clone_private_mount()
2287 struct mount *mnt; in iterate_mounts()
2299 static void lock_mnt_tree(struct mount *mnt) in lock_mnt_tree()
2301 struct mount *p; in lock_mnt_tree()
2305 /* Don't allow unprivileged users to change mount flags */ in lock_mnt_tree()
2319 /* Don't allow unprivileged users to reveal what is under a mount */ in lock_mnt_tree()
2326 static void cleanup_group_ids(struct mount *mnt, struct mount *end) in cleanup_group_ids()
2328 struct mount *p; in cleanup_group_ids()
2336 static int invent_group_ids(struct mount *mnt, bool recurse) in invent_group_ids()
2338 struct mount *p; in invent_group_ids()
2353 int count_mounts(struct mnt_namespace *ns, struct mount *mnt) in count_mounts()
2357 struct mount *p; in count_mounts()
2382 * attach_recursive_mnt - attach a source mount tree
2383 * @source_mnt: mount tree to be attached
2384 * @top_mnt: mount that @source_mnt will be mounted on or mounted beneath
2388 * NOTE: in the table below explains the semantics when a source mount
2389 * of a given type is attached to a destination mount of a given type.
2391 * | BIND MOUNT OPERATION |
2402 * A bind operation clones the source mount and mounts the clone on the
2403 * destination mount.
2405 * (++) the cloned mount is propagated to all the mounts in the propagation
2406 * tree of the destination mount and the cloned mount is added to
2407 * the peer group of the source mount.
2408 * (+) the cloned mount is created under the destination mount and is marked
2409 * as shared. The cloned mount is added to the peer group of the source
2410 * mount.
2411 * (+++) the mount is propagated to all the mounts in the propagation tree
2412 * of the destination mount and the cloned mount is made slave
2413 * of the same master as that of the source mount. The cloned mount
2415 * (*) the cloned mount is made a slave of the same master as that of the
2416 * source mount.
2419 * | MOVE MOUNT OPERATION |
2431 * (+) the mount is moved to the destination. And is then propagated to
2432 * all the mounts in the propagation tree of the destination mount.
2433 * (+*) the mount is moved to the destination.
2434 * (+++) the mount is moved to the destination and is then propagated to
2435 * all the mounts belonging to the destination mount's propagation tree.
2436 * the mount is marked as 'shared and slave'.
2437 * (*) the mount continues to be a slave at the new location.
2439 * if the source mount is a tree, the operations explained above is
2440 * applied to each mount in the tree.
2448 static int attach_recursive_mnt(struct mount *source_mnt, in attach_recursive_mnt()
2449 struct mount *top_mnt, in attach_recursive_mnt()
2457 struct mount *child, *dest_mnt, *p; in attach_recursive_mnt()
2470 /* Is there space to add these mounts to the mount namespace? */ in attach_recursive_mnt()
2520 struct mount *q; in attach_recursive_mnt()
2539 child = hlist_entry(tree_list.first, struct mount, mnt_hash); in attach_recursive_mnt()
2556 * do_lock_mount - lock mount and mountpoint
2558 * @beneath: whether the intention is to mount beneath @path
2560 * Follow the mount stack on @path until the top mount @mnt is found. If
2562 * mount stacked on top of it. Then simply follow @{mnt,mnt->mnt_root}
2565 * Acquire the inode_lock() on the top mount's ->mnt_root to protect
2566 * against concurrent removal of the new mountpoint from another mount
2571 * concurrent unlink of @mp->mnt_dentry from another mount namespace
2572 * where @mnt doesn't have a child mount mounted @mp. A concurrent
2586 * Return: Either the target mountpoint on the top mount or the top
2587 * mount's mountpoint.
2596 struct mount *m; in do_lock_mount()
2664 static int graft_tree(struct mount *mnt, struct mount *p, struct mountpoint *mp) in graft_tree()
2698 struct mount *m; in do_change_type()
2699 struct mount *mnt = real_mount(path->mnt); in do_change_type()
2728 static struct mount *__do_loopback(struct path *old_path, int recurse) in __do_loopback()
2730 struct mount *mnt = ERR_PTR(-EINVAL), *old = real_mount(old_path->mnt); in __do_loopback()
2753 * do loopback mount.
2759 struct mount *mnt = NULL, *parent; in do_loopback()
2805 struct mount *mnt, *p; in open_detached_copy()
2891 * Don't allow locked mount flags to be cleared.
2896 static bool can_change_locked_flags(struct mount *mnt, unsigned int mnt_flags) in can_change_locked_flags()
2923 static int change_mount_ro_state(struct mount *mnt, unsigned int mnt_flags) in change_mount_ro_state()
2937 static void set_mount_attributes(struct mount *mnt, unsigned int mnt_flags) in set_mount_attributes()
2976 * to mount(2).
2981 struct mount *mnt = real_mount(path->mnt); in do_reconfigure_mnt()
3020 struct mount *mnt = real_mount(path->mnt); in do_remount()
3038 * from the legacy mount system call. in do_remount()
3063 static inline int tree_contains_unbindable(struct mount *mnt) in tree_contains_unbindable()
3065 struct mount *p; in tree_contains_unbindable()
3074 * Check that there aren't references to earlier/same mount namespaces in the
3075 * specified subtree. Such references can act as pins for mount namespaces
3076 * that aren't checked by the mount-cycle checking code, thereby allowing
3079 static bool check_for_nsfs_mounts(struct mount *subtree) in check_for_nsfs_mounts()
3081 struct mount *p; in check_for_nsfs_mounts()
3097 struct mount *from, *to; in do_set_group()
3113 /* We should be allowed to modify mount namespaces of both mounts */ in do_set_group()
3120 /* To and From paths should be mount roots */ in do_set_group()
3130 /* From mount root should be wider than To mount root */ in do_set_group()
3134 /* From mount should not have locked children in place of To's root */ in do_set_group()
3147 struct mount *m = from->mnt_master; in do_set_group()
3171 * Check if path is overmounted, i.e., if there's a mount on top of
3189 * can_move_mount_beneath - check that we can mount beneath the top mount
3190 * @from: mount to mount beneath
3191 * @to: mount under which to mount
3194 * - Make sure that @to->dentry is actually the root of a mount under
3195 * which we can mount another mount.
3198 * - Make sure that the caller can unmount the topmost mount ensuring
3202 * - Prevent mounting beneath a mount if the propagation relationship
3203 * between the source mount, parent mount, and top mount would lead to
3204 * nonsensical mount trees.
3213 struct mount *mnt_from = real_mount(from->mnt), in can_move_mount_beneath()
3226 /* Avoid creating shadow mounts during mount propagation. */ in can_move_mount_beneath()
3239 for (struct mount *p = mnt_from; mnt_has_parent(p); p = p->mnt_parent) in can_move_mount_beneath()
3244 * If the parent mount propagates to the child mount this would in can_move_mount_beneath()
3247 * defeats the whole purpose of mounting beneath another mount. in can_move_mount_beneath()
3274 struct mount *p; in do_move_mount()
3275 struct mount *old; in do_move_mount()
3276 struct mount *parent; in do_move_mount()
3318 * Don't move a mount residing in a shared parent. in do_move_mount()
3334 * Don't move a mount tree containing unbindable mounts to a destination in do_move_mount()
3335 * mount which is shared. in do_move_mount()
3350 /* if the mount is moved, it should no longer be expire in do_move_mount()
3384 * add a mount into a namespace's mount tree
3386 static int do_add_mount(struct mount *newmnt, struct mountpoint *mp, in do_add_mount()
3389 struct mount *parent = real_mount(path->mnt); in do_add_mount()
3402 /* Refuse the same filesystem on the same mount point */ in do_add_mount()
3416 * Create a new mount using a superblock configuration and request it
3457 * create a new mount for userspace and request it to be added into the
3492 * Indicate to the filesystem that the mount request is coming in do_new_mount()
3493 * from the legacy mount system call. in do_new_mount()
3519 struct mount *mnt; in finish_automount()
3528 /* The new mount record should have at least 2 refs to prevent it being in finish_automount()
3542 * got", not "try to mount it on top". in finish_automount()
3583 * mnt_set_expiry - Put a mount on an expiration list
3584 * @mnt: The mount to list.
3585 * @expiry_list: The list to add the mount to.
3604 struct mount *mnt, *next; in mark_mounts_for_expiry()
3626 mnt = list_first_entry(&graveyard, struct mount, mnt_expire); in mark_mounts_for_expiry()
3642 static int select_submounts(struct mount *parent, struct list_head *graveyard) in select_submounts()
3644 struct mount *this_parent = parent; in select_submounts()
3653 struct mount *mnt = list_entry(tmp, struct mount, mnt_child); in select_submounts()
3688 static void shrink_submounts(struct mount *mnt) in shrink_submounts()
3691 struct mount *m; in shrink_submounts()
3696 m = list_first_entry(&graveyard, struct mount, in shrink_submounts()
3747 * be given to the mount() call (ie: read-only, no-dev, no-suid etc).
3753 * Pre-0.97 versions of mount() didn't have a flags word.
3872 * mount a reference to an older mount namespace into the current
3873 * mount namespace, preventing reference counting loops. A 64bit
3921 struct mount *p, *q; in copy_mnt_ns()
3922 struct mount *old; in copy_mnt_ns()
3923 struct mount *new; in copy_mnt_ns()
4000 struct mount *mnt = real_mount(m); in mount_subtree()
4034 SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name, in SYSCALL_DEFINE5() argument
4099 * Create a kernel mount representation for a new, prepared superblock
4109 struct mount *mnt; in SYSCALL_DEFINE3()
4152 /* There must be a valid superblock or we can't mount it */ in SYSCALL_DEFINE3()
4159 pr_warn("VFS: Mount too revealing\n"); in SYSCALL_DEFINE3()
4178 /* We've done the mount bit - now move the file context into more or in SYSCALL_DEFINE3()
4223 * Move a mount from one place to another. In combination with
4224 * fsopen()/fsmount() this is used to install a new mount and in combination
4226 * a mount subtree.
4293 bool is_path_reachable(struct mount *mnt, struct dentry *dentry, in is_path_reachable()
4334 * /nfs/my_root where /nfs is the mount point. It must be a mountpoint,
4335 * though, so you may need to say mount --bind /nfs/my_root /nfs/my_root
4342 struct mount *new_mnt, *root_mnt, *old_mnt, *root_parent, *ex_parent; in SYSCALL_DEFINE2()
4411 /* mount old root on put_old */ in SYSCALL_DEFINE2()
4413 /* mount new_root on / */ in SYSCALL_DEFINE2()
4417 /* A moved mount should not expire automatically */ in SYSCALL_DEFINE2()
4437 static unsigned int recalc_flags(struct mount_kattr *kattr, struct mount *mnt) in recalc_flags()
4449 static int can_idmap_mount(const struct mount_kattr *kattr, struct mount *mnt) in can_idmap_mount()
4458 * Creating an idmapped mount with the filesystem wide idmapping in can_idmap_mount()
4465 * Once a mount has been idmapped we don't allow it to change its in can_idmap_mount()
4467 * another bind-mount they can idmap if they want to. in can_idmap_mount()
4484 /* Mount has already been visible in the filesystem hierarchy. */ in can_idmap_mount()
4493 * @kattr: the new mount attributes
4494 * @mnt: the mount to which @kattr will be applied
4496 * Check whether thew new mount attributes in @kattr allow concurrent writers.
4501 const struct mount *mnt) in mnt_allow_writers()
4508 static int mount_setattr_prepare(struct mount_kattr *kattr, struct mount *mnt) in mount_setattr_prepare()
4510 struct mount *m; in mount_setattr_prepare()
4534 struct mount *p; in mount_setattr_prepare()
4539 * mounts and needs to take care to include the first mount. in mount_setattr_prepare()
4547 * We're done once the first mount we changed got in mount_setattr_prepare()
4557 static void do_idmap_mount(const struct mount_kattr *kattr, struct mount *mnt) in do_idmap_mount()
4565 * Since we only allow a mount to change the idmapping once and in do_idmap_mount()
4566 * verified this in can_idmap_mount() we know that the mount has in do_idmap_mount()
4573 static void mount_setattr_commit(struct mount_kattr *kattr, struct mount *mnt) in mount_setattr_commit()
4575 struct mount *m; in mount_setattr_commit()
4598 struct mount *mnt = real_mount(path->mnt); in do_mount_setattr()
4636 * If this is an attached mount make sure it's located in the callers in do_mount_setattr()
4637 * mount namespace. If it's not don't let the caller interact with it. in do_mount_setattr()
4639 * If this mount doesn't have a parent it's most often simply a in do_mount_setattr()
4640 * detached mount with an anonymous mount namespace. IOW, something in do_mount_setattr()
4642 * that do change mount properties on the rootfs itself. That obviously in do_mount_setattr()
4643 * neither has a parent nor is it a detached mount so we cannot in do_mount_setattr()
4650 * First, we get the mount tree in a shape where we can change mount in do_mount_setattr()
4682 * We currently do not support clearing an idmapped mount. If this ever in build_mount_idmapped()
4709 * mount. We use the initial idmapping as an indicator of a mount in build_mount_idmapped()
4869 struct mount *mnt = mnt_find_id_at(ns, id); in lookup_mnt_in_ns()
4918 static u64 mnt_to_propagation_flags(struct mount *m) in mnt_to_propagation_flags()
4947 struct mount *m = real_mount(s->mnt); in statmount_mnt_basic()
4962 struct mount *m = real_mount(s->mnt); in statmount_propagate_from()
5107 static struct mount *listmnt_next(struct mount *curr, bool reverse) in listmnt_next()
5121 struct mount *first, *child; in grab_requested_root()
5132 * We have to find the first mount in our ns and use that, however it in grab_requested_root()
5156 struct mount *m; in do_statmount()
5276 /* The first valid unique mount id is MNT_UNIQUE_ID_OFFSET + 1. */ in copy_mnt_id_req()
5283 * If the user requested a specific mount namespace id, look that up and return
5284 * that, or if not simply grab a passive reference on our mount namespace and
5372 struct mount *r, *first; in do_listmount()
5441 * If the mount namespace really has more than 1 million mounts the in SYSCALL_DEFINE4()
5442 * caller must iterate over the mount namespace (and reconsider their in SYSCALL_DEFINE4()
5456 /* The first valid unique mount id is MNT_UNIQUE_ID_OFFSET + 1. */ in SYSCALL_DEFINE4()
5488 struct mount *m; in init_mount_tree()
5520 mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct mount), in mnt_init()
5523 mount_hashtable = alloc_large_system_hash("Mount-cache", in mnt_init()
5535 panic("Failed to allocate mount hash table\n"); in mnt_init()
5565 * it is a longterm mount, don't release mnt until in kern_mount()
5576 /* release long term mount so mount point can be released */ in kern_unmount()
5631 struct mount *mnt, *n; in mnt_already_visible()
5636 struct mount *child; in mnt_already_visible()
5642 /* This mount is not fully visible if it's root directory in mnt_already_visible()
5648 /* A local view of the mount flags */ in mnt_already_visible()
5655 /* Verify the mount flags are equal to or more permissive in mnt_already_visible()
5656 * than the proposed new mount. in mnt_already_visible()
5665 /* This mount is not fully visible if there are any in mnt_already_visible()
5808 .procname = "mount-max",