Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:@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

Proto:static int attach_recursive_mnt(struct mount *source_mnt, struct mount *dest_mnt, struct mountpoint *dest_mp, bool moving)

Type:int

Parameter:

TypeParameterName
struct mount *source_mnt
struct mount *dest_mnt
struct mountpoint *dest_mp
boolmoving
2045  user_ns = user_ns
2047  ns = containing namespace
2056  smp = get_mountpoint( root of the mounted tree )
2057  If IS_ERR(smp) Then Return PTR_ERR(smp)
2061  If Not moving Then
2062  err = count_mounts(ns, source_mnt)
2063  If err Then Go to out
2067  If IS_MNT_SHARED(dest_mnt) Then
2068  err = invent_group_ids(source_mnt, true)
2069  If err Then Go to out
2071  err = propagate_mnt(dest_mnt, dest_mp, source_mnt, & tree_list)
2072  lock_mount_hash()
2073  If err Then Go to out_cleanup_ids
2075  When p cycle set_mnt_shared(p)
2077  Else
2078  lock_mount_hash()
2080  If moving Then
2081  vfsmount lock must be held for write
2082  vfsmount lock must be held for write
2083  vfsmount lock must be held for write
2084  Else
2085  If containing namespace Then
2089  vfsmount lock must be held for write
2090  vfsmount lock must be held for write
2095  hlist_del_init( & mnt_hash)
2096  q = d the first mount at @dentry on vfsmount @mnt.* call under rcu_read_lock()
2098  If q Then mnt_change_mountpoint(child, smp, q)
2101  If user_ns != user_ns Then lock_mnt_tree(child)
2103  mnt_flags &= ~MNT_LOCKED
2104  vfsmount lock must be held for write
2106  alled with namespace_lock and vfsmount lock
2107  unlock_mount_hash()
2109  Return 0
2111  out_cleanup_ids :
2112  When Not hlist_empty( & tree_list) cycle
2113  child = hlist_entry(first, structmount, mnt_hash)
2114  pending_mounts = 0
2115  mount_lock must be held* namespace_sem must be held for write
2117  unlock_mount_hash()
2118  cleanup_group_ids(source_mnt, NULL)
2119  out :
2120  pending_mounts = 0
2122  A locking reader exclusively locks out other writers and locking readers,* but doesn't update the sequence number. Acts like a normal spin_lock/unlock.* Don't need preempt_disable() because that is in the spin_lock already.
2123  alled with namespace_lock and vfsmount lock
2124  read_sequnlock_excl( & vfsmount lock may be taken for read to prevent changes to the* vfsmount hash, ie. during mountpoint lookups or walking back* up the tree.* It should be taken for write in all cases where the vfsmount)
2126  Return err
Caller
NameDescribe
graft_tree
do_move_mount