Lines Matching full:mount
33 /* Maximum number of mounts in a mount namespace */
99 static int mnt_alloc_id(struct mount *mnt) in mnt_alloc_id()
109 static void mnt_free_id(struct mount *mnt) in mnt_free_id()
117 static int mnt_alloc_group_id(struct mount *mnt) in mnt_alloc_group_id()
130 void mnt_release_group_id(struct mount *mnt) in mnt_release_group_id()
139 static inline void mnt_add_count(struct mount *mnt, int n) in mnt_add_count()
153 unsigned int mnt_get_count(struct mount *mnt) in mnt_get_count()
171 struct mount *m = container_of(p, struct mount, mnt_umount); in drop_mountpoint()
177 static struct mount *alloc_vfsmnt(const char *name) in alloc_vfsmnt()
179 struct mount *mnt = kmem_cache_zalloc(mnt_cache, GFP_KERNEL); in alloc_vfsmnt()
238 * __mnt_is_readonly: check whether a mount is read-only
239 * @mnt: the mount to check for its write status
258 static inline void mnt_inc_writers(struct mount *mnt) in mnt_inc_writers()
267 static inline void mnt_dec_writers(struct mount *mnt) in mnt_dec_writers()
276 static unsigned int mnt_get_writers(struct mount *mnt) in mnt_get_writers()
308 * __mnt_want_write - get write access to a mount without freeze protection
309 * @m: the mount on which to take a write
319 struct mount *mnt = real_mount(m); in __mnt_want_write()
348 * mnt_want_write - get write access to a mount
349 * @m: the mount on which to take a write
352 * it, and makes sure that writes are allowed (mount is read-write, filesystem
369 * mnt_clone_write - get write access to a mount
370 * @mnt: the mount on which to take a write
393 * __mnt_want_write_file - get write access to a file's mount
394 * @file: the file who's mount on which to take a write
408 * mnt_want_write_file - get write access to a file's mount
409 * @file: the file who's mount on which to take a write
427 * __mnt_drop_write - give up write access to a mount
428 * @mnt: the mount on which to give up write access
442 * mnt_drop_write - give up write access to a mount
443 * @mnt: the mount on which to give up write access
468 static int mnt_make_readonly(struct mount *mnt) in mnt_make_readonly()
510 static void __mnt_unmake_readonly(struct mount *mnt) in __mnt_unmake_readonly()
519 struct mount *mnt; in sb_prepare_remount_readonly()
553 static void free_vfsmnt(struct mount *mnt) in free_vfsmnt()
564 free_vfsmnt(container_of(head, struct mount, mnt_rcu)); in delayed_free_vfsmnt()
570 struct mount *mnt; in __legitimize_mnt()
610 * find the first mount at @dentry on vfsmount @mnt.
613 struct mount *__lookup_mnt(struct vfsmount *mnt, struct dentry *dentry) in __lookup_mnt()
616 struct mount *p; in __lookup_mnt()
625 * lookup_mnt - Return the first child mount mounted at path
630 * mount /dev/sda1 /mnt
631 * mount /dev/sda2 /mnt
632 * mount /dev/sda3 /mnt
634 * Then lookup_mnt() on the base /mnt dentry in the root mount will
642 struct mount *child_mnt; in lookup_mnt()
658 * current mount namespace.
663 * mounts in the current mount namespace and test to see if the dentry
667 * need to identify all mounts that may be in the current mount
668 * namespace not just a mount that happens to have some specified
669 * parent mount.
674 struct mount *mnt; in __is_local_mountpoint()
768 static inline int check_mnt(struct mount *mnt) in check_mnt()
798 static void unhash_mnt(struct mount *mnt) in unhash_mnt()
812 static void detach_mnt(struct mount *mnt, struct path *old_path) in detach_mnt()
822 static void umount_mnt(struct mount *mnt) in umount_mnt()
832 void mnt_set_mountpoint(struct mount *mnt, in mnt_set_mountpoint()
834 struct mount *child_mnt) in mnt_set_mountpoint()
844 static void __attach_mnt(struct mount *mnt, struct mount *parent) in __attach_mnt()
854 static void attach_mnt(struct mount *mnt, in attach_mnt()
855 struct mount *parent, in attach_mnt()
862 void mnt_change_mountpoint(struct mount *parent, struct mountpoint *mp, struct mount *mnt) in mnt_change_mountpoint()
866 struct mount *old_parent = mnt->mnt_parent; in mnt_change_mountpoint()
878 * lock the mount hash by taking advantage of the knowledge that in mnt_change_mountpoint()
882 * During mounting, the mount passed in as the parent mount will in mnt_change_mountpoint()
897 static void commit_tree(struct mount *mnt) in commit_tree()
899 struct mount *parent = mnt->mnt_parent; in commit_tree()
900 struct mount *m; in commit_tree()
919 static struct mount *next_mnt(struct mount *p, struct mount *root) in next_mnt()
932 return list_entry(next, struct mount, mnt_child); in next_mnt()
935 static struct mount *skip_mnt_tree(struct mount *p) in skip_mnt_tree()
939 p = list_entry(prev, struct mount, mnt_child); in skip_mnt_tree()
948 struct mount *mnt; in vfs_kern_mount()
984 * through from the parent mount to the submount don't support in vfs_submount()
994 static struct mount *clone_mnt(struct mount *old, struct dentry *root, in clone_mnt()
998 struct mount *mnt; in clone_mnt()
1018 /* Don't allow unprivileged users to change mount flags */ in clone_mnt()
1035 /* Don't allow unprivileged users to reveal what is under a mount */ in clone_mnt()
1066 /* stick the duplicate mount on the same expiry list in clone_mnt()
1081 static void cleanup_mnt(struct mount *mnt) in cleanup_mnt()
1105 cleanup_mnt(container_of(head, struct mount, mnt_rcu)); in __cleanup_mnt()
1112 struct mount *m, *t; in delayed_mntput()
1119 static void mntput_no_expire(struct mount *mnt) in mntput_no_expire()
1159 struct mount *p, *tmp; in mntput_no_expire()
1183 struct mount *m = real_mount(mnt); in mntput()
1200 /* path_is_mountpoint() - Check if path is a mount in the current
1231 struct mount *p; in mnt_clone_internal()
1279 struct mount *r = list_entry(v, struct mount, mnt_list); in m_show()
1292 * may_umount_tree - check if a mount tree is busy
1293 * @mnt: root of mount tree
1301 struct mount *mnt = real_mount(m); in may_umount_tree()
1304 struct mount *p; in may_umount_tree()
1324 * may_umount - check if a mount point is busy
1325 * @mnt: root of mount
1327 * This is called to check if a mount point has any
1329 * mount has sub mounts this will return busy
1379 static bool disconnect_mount(struct mount *mnt, enum umount_tree_flags how) in disconnect_mount()
1385 /* A mount without a parent has nothing to be connected to */ in disconnect_mount()
1396 /* Has it been requested that the mount remain connected? */ in disconnect_mount()
1400 /* Is the mount locked such that it needs to remain connected? */ in disconnect_mount()
1404 /* By default disconnect the mount */ in disconnect_mount()
1412 static void umount_tree(struct mount *mnt, enum umount_tree_flags how) in umount_tree()
1415 struct mount *p; in umount_tree()
1438 p = list_first_entry(&tmp_list, struct mount, mnt_list); in umount_tree()
1467 static void shrink_submounts(struct mount *mnt);
1469 static int do_umount(struct mount *mnt, int flags) in do_umount()
1506 * mount, and they will themselves hold resources we must in do_umount()
1510 * must return, and the like. Thats for the mount program to worry in do_umount()
1573 * to an existing mountpoint, and wind up leaking the mount.
1582 struct mount *mnt; in __detach_mounts()
1592 mnt = hlist_entry(mp->m_list.first, struct mount, mnt_mp_list); in __detach_mounts()
1622 * Now umount can handle mount points as well as block devices.
1632 struct mount *mnt; in ksys_umount()
1688 /* Is this a proxy for a mount namespace? */ in is_mnt_ns_file()
1700 /* Could bind mounting the mount namespace inode cause a in mnt_ns_loop()
1701 * mount namespace loop? in mnt_ns_loop()
1711 struct mount *copy_tree(struct mount *mnt, struct dentry *dentry, in copy_tree()
1714 struct mount *res, *p, *q, *r, *parent; in copy_tree()
1730 struct mount *s; in copy_tree()
1780 struct mount *tree; in collect_mounts()
1807 * to the originating mount won't be propagated into this).
1813 struct mount *old_mnt = real_mount(path->mnt); in clone_private_mount()
1814 struct mount *new_mnt; in clone_private_mount()
1830 struct mount *mnt; in iterate_mounts()
1842 static void cleanup_group_ids(struct mount *mnt, struct mount *end) in cleanup_group_ids()
1844 struct mount *p; in cleanup_group_ids()
1852 static int invent_group_ids(struct mount *mnt, bool recurse) in invent_group_ids()
1854 struct mount *p; in invent_group_ids()
1869 int count_mounts(struct mnt_namespace *ns, struct mount *mnt) in count_mounts()
1873 struct mount *p; in count_mounts()
1892 * @source_mnt : mount tree to be attached
1893 * @nd : place the mount tree @source_mnt is attached
1895 * store the parent mount and mountpoint dentry.
1898 * NOTE: in the table below explains the semantics when a source mount
1899 * of a given type is attached to a destination mount of a given type.
1901 * | BIND MOUNT OPERATION |
1912 * A bind operation clones the source mount and mounts the clone on the
1913 * destination mount.
1915 * (++) the cloned mount is propagated to all the mounts in the propagation
1916 * tree of the destination mount and the cloned mount is added to
1917 * the peer group of the source mount.
1918 * (+) the cloned mount is created under the destination mount and is marked
1919 * as shared. The cloned mount is added to the peer group of the source
1920 * mount.
1921 * (+++) the mount is propagated to all the mounts in the propagation tree
1922 * of the destination mount and the cloned mount is made slave
1923 * of the same master as that of the source mount. The cloned mount
1925 * (*) the cloned mount is made a slave of the same master as that of the
1926 * source mount.
1929 * | MOVE MOUNT OPERATION |
1941 * (+) the mount is moved to the destination. And is then propagated to
1942 * all the mounts in the propagation tree of the destination mount.
1943 * (+*) the mount is moved to the destination.
1944 * (+++) the mount is moved to the destination and is then propagated to
1945 * all the mounts belonging to the destination mount's propagation tree.
1946 * the mount is marked as 'shared and slave'.
1947 * (*) the mount continues to be a slave at the new location.
1949 * if the source mount is a tree, the operations explained above is
1950 * applied to each mount in the tree.
1954 static int attach_recursive_mnt(struct mount *source_mnt, in attach_recursive_mnt()
1955 struct mount *dest_mnt, in attach_recursive_mnt()
1962 struct mount *child, *p; in attach_recursive_mnt()
1973 /* Is there space to add these mounts to the mount namespace? */ in attach_recursive_mnt()
2003 struct mount *q; in attach_recursive_mnt()
2018 child = hlist_entry(tree_list.first, struct mount, mnt_hash); in attach_recursive_mnt()
2075 static int graft_tree(struct mount *mnt, struct mount *p, struct mountpoint *mp) in graft_tree()
2109 struct mount *m; in do_change_type()
2110 struct mount *mnt = real_mount(path->mnt); in do_change_type()
2139 static bool has_locked_children(struct mount *mnt, struct dentry *dentry) in has_locked_children()
2141 struct mount *child; in has_locked_children()
2153 * do loopback mount.
2159 struct mount *mnt = NULL, *old, *parent; in do_loopback()
2245 struct mount *mnt = real_mount(path->mnt); in do_remount()
2302 static inline int tree_contains_unbindable(struct mount *mnt) in tree_contains_unbindable()
2304 struct mount *p; in tree_contains_unbindable()
2315 struct mount *p; in do_move_mount()
2316 struct mount *old; in do_move_mount()
2351 * Don't move a mount residing in a shared parent. in do_move_mount()
2356 * Don't move a mount tree containing unbindable mounts to a destination in do_move_mount()
2357 * mount which is shared. in do_move_mount()
2370 /* if the mount is moved, it should no longer be expire in do_move_mount()
2406 * add a mount into a namespace's mount tree
2408 static int do_add_mount(struct mount *newmnt, struct path *path, int mnt_flags) in do_add_mount()
2411 struct mount *parent; in do_add_mount()
2431 /* Refuse the same filesystem on the same mount point */ in do_add_mount()
2452 * create a new mount for userspace and request it to be added into the
2491 struct mount *mnt = real_mount(m); in finish_automount()
2493 /* The new mount record should have at least 2 refs to prevent it being in finish_automount()
2520 * mnt_set_expiry - Put a mount on an expiration list
2521 * @mnt: The mount to list.
2522 * @expiry_list: The list to add the mount to.
2541 struct mount *mnt, *next; in mark_mounts_for_expiry()
2563 mnt = list_first_entry(&graveyard, struct mount, mnt_expire); in mark_mounts_for_expiry()
2579 static int select_submounts(struct mount *parent, struct list_head *graveyard) in select_submounts()
2581 struct mount *this_parent = parent; in select_submounts()
2590 struct mount *mnt = list_entry(tmp, struct mount, mnt_child); in select_submounts()
2625 static void shrink_submounts(struct mount *mnt) in shrink_submounts()
2628 struct mount *m; in shrink_submounts()
2633 m = list_first_entry(&graveyard, struct mount, in shrink_submounts()
2708 * be given to the mount() call (ie: read-only, no-dev, no-suid etc).
2714 * Pre-0.97 versions of mount() didn't have a flags word.
2826 * mount a reference to an older mount namespace into the current
2827 * mount namespace, preventing reference counting loops. A 64bit
2874 struct mount *p, *q; in copy_mnt_ns()
2875 struct mount *old; in copy_mnt_ns()
2876 struct mount *new; in copy_mnt_ns()
2951 struct mount *mnt = real_mount(m); in create_mnt_ns()
3026 SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name, in SYSCALL_DEFINE5() argument
3037 bool is_path_reachable(struct mount *mnt, struct dentry *dentry, in is_path_reachable()
3078 * /nfs/my_root where /nfs is the mount point. It must be a mountpoint,
3079 * though, so you may need to say mount --bind /nfs/my_root /nfs/my_root
3086 struct mount *new_mnt, *root_mnt, *old_mnt; in SYSCALL_DEFINE2()
3153 /* mount old root on put_old */ in SYSCALL_DEFINE2()
3155 /* mount new_root on / */ in SYSCALL_DEFINE2()
3158 /* A moved mount should not expire automatically */ in SYSCALL_DEFINE2()
3214 mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct mount), in mnt_init()
3217 mount_hashtable = alloc_large_system_hash("Mount-cache", in mnt_init()
3229 panic("Failed to allocate mount hash table\n"); in mnt_init()
3258 * it is a longterm mount, don't release mnt until in kern_mount_data()
3269 /* release long term mount so mount point can be released */ in kern_unmount()
3311 struct mount *mnt; in mnt_already_visible()
3316 struct mount *child; in mnt_already_visible()
3322 /* This mount is not fully visible if it's root directory in mnt_already_visible()
3328 /* A local view of the mount flags */ in mnt_already_visible()
3335 /* Verify the mount flags are equal to or more permissive in mnt_already_visible()
3336 * than the proposed new mount. in mnt_already_visible()
3345 /* This mount is not fully visible if there are any in mnt_already_visible()