Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\namespace.c Create Date:2022-07-28 20:09:18
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:do_move_mount

Proto:static int do_move_mount(struct path *old_path, struct path *new_path)

Type:int

Parameter:

TypeParameterName
struct path *old_path
struct path *new_path
2608  mp = lock_mount(new_path)
2609  If IS_ERR(mp) Then Return PTR_ERR(mp)
2612  old = real_mount(mnt)
2613  p = real_mount(mnt)
2614  parent = mnt_parent
2615  attached = mnt_has_parent(old)
2616  old_mp = where is it mounted
2617  ns = containing namespace
2619  err = -EINVAL
2621  If Not check_mnt(p) Then Go to out
2625  If Not is_mounted( & mnt) Then Go to out
2629  If Not If attached Then check_mnt(old) Else is_anon_ns(ns) Then Go to out
2632  If mnt_flags & MNT_LOCKED Then Go to out
2635  If dentry != mnt_root Then Go to out
2638  If d_is_dir(dentry) != d_is_dir(dentry) Then Go to out
2644  If attached && IS_MNT_SHARED(parent) Then Go to out
2650  If IS_MNT_SHARED(p) && tree_contains_unbindable(old) Then Go to out
2652  err = -ELOOP
2653  If Not Check that there aren't references to earlier/same mount namespaces in the* specified subtree. Such references can act as pins for mount namespaces* that aren't checked by the mount-cycle checking code, thereby allowing* cycles to be made. Then Go to out
2655  When mnt_has_parent(p) cycle If p == old Then
2657  Go to out
2659  err = @source_mnt : mount tree to be attached*@nd : place the mount tree @source_mnt is attached*@parent_nd : if non-null, detach the source_mnt from its parent and* store the parent mount and mountpoint dentry
2661  If err Then Go to out
2666  list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
2667  If attached Then alled with namespace_lock and vfsmount lock
2669  out :
2670  unlock_mount(mp)
2671  If Not err Then
2672  If attached Then mntput_no_expire(parent)
2674  Else free_mnt_ns(ns)
2677  Return err
Caller
NameDescribe
do_move_mount_old
SYSCALL_DEFINE5Move a mount from one place to another. In combination with* fsopen()/fsmount() this is used to install a new mount and in combination* with open_tree(OPEN_TREE_CLONE [| AT_RECURSIVE]) it can be used to copy* a mount subtree.