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:copy_tree

Proto:struct mount *copy_tree(struct mount *mnt, struct dentry *dentry, int flag)

Type:struct mount

Parameter:

TypeParameterName
struct mount *mnt
struct dentry *dentry
intflag
1754  If Not (flag & CL_COPY_UNBINDABLE) && IS_MNT_UNBINDABLE(mnt) Then Return ERR_PTR( - EINVAL)
1757  If Not (flag & CL_COPY_MNT_NS_FILE) && is_mnt_ns_file(dentry) Then Return ERR_PTR( - EINVAL)
1760  res = q = clone_mnt(mnt, dentry, flag)
1761  If IS_ERR(q) Then Return q
1764  mnt_mountpoint = mnt_mountpoint
1766  p = mnt
1769  If Not is new dentry a subdirectory of old_dentry Then Continue
1772  When s cycle
1773  If Not (flag & CL_COPY_UNBINDABLE) && IS_MNT_UNBINDABLE(s) Then
1775  If mnt_flags & MNT_LOCKED Then
1777  q = ERR_PTR( - EPERM)
1778  Go to out
1779  Else
1780  s = skip_mnt_tree(s)
1781  Continue
1786  s = skip_mnt_tree(s)
1787  Continue
1789  When p != mnt_parent cycle
1790  p = mnt_parent
1791  q = mnt_parent
1793  p = s
1794  parent = q
1795  q = clone_mnt(p, root of the mounted tree , flag)
1796  If IS_ERR(q) Then Go to out
1798  lock_mount_hash()
1799  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
1800  vfsmount lock must be held for write
1801  unlock_mount_hash()
1804  Return res
1805  out :
1806  If res Then
1807  lock_mount_hash()
1808  mount_lock must be held* namespace_sem must be held for write
1809  unlock_mount_hash()
1811  Return q
Caller
NameDescribe
collect_mountsCaller should check returned pointer for errors
__do_loopback
copy_mnt_ns
propagate_one