函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\namespace.c Create Date:2022-07-29 10:39:36
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:@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

函数原型:static int attach_recursive_mnt(struct mount *source_mnt, struct mount *dest_mnt, struct mountpoint *dest_mp, bool moving)

返回类型:int

参数:

类型参数名称
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  如果是错误则返回:错误
2061  如果非moving
2062  err等于count_mounts(ns, source_mnt)
2063  如果err则转到:out
2067  如果IS_MNT_SHARED(dest_mnt)则
2068  err等于invent_group_ids(source_mnt, true)
2069  如果err则转到:out
2071  err等于propagate_mnt(dest_mnt, dest_mp, source_mnt, & tree_list)
2072  lock_mount_hash()
2073  如果err则转到:out_cleanup_ids
2075 p循环set_mnt_shared(p)
2077  否则
2078  lock_mount_hash()
2080  如果moving
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  否则
2085  如果 containing namespace
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  如果qmnt_change_mountpoint(child, smp, q)
2101  如果user_ns不等于user_nslock_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  返回:0
2111  out_cleanup_ids :
2112  当非hlist_empty( & tree_list)循环
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  返回:err
调用者
名称描述
graft_tree
do_move_mount