Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:clone_mnt

Proto:static struct mount *clone_mnt(struct mount *old, struct dentry *root, int flag)

Type:struct mount

Parameter:

TypeParameterName
struct mount *old
struct dentry *root
intflag
1019  sb = pointer to superblock
1023  mnt = alloc_vfsmnt( Name of device e.g. /dev/dsk/hda1 )
1024  If Not mnt Then Return ERR_PTR( - ENOMEM)
1027  If flag & ( CL_SLAVE | CL_PRIVATE | CL_SHARED_TO_SLAVE) Then peer group identifier = 0
1029  Else peer group identifier = peer group identifier
1032  If flag & CL_MAKE_SHARED && Not peer group identifier Then
1033  err = Allocate a new peer group ID
1034  If err Then Go to out_free
1038  mnt_flags = mnt_flags
1039  mnt_flags &= ~( MNT_WRITE_HOLD | MNT_MARKED | MNT_INTERNAL)
1041  atomic_inc( & s_active)
1042  pointer to superblock = sb
1043  root of the mounted tree = get a reference to a dentry
1044  mnt_mountpoint = root of the mounted tree
1045  mnt_parent = mnt
1046  lock_mount_hash()
1047  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.
1048  unlock_mount_hash()
1050  If flag & CL_SLAVE || flag & CL_SHARED_TO_SLAVE && IS_MNT_SHARED(old) Then
1052  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
1053  slave is on master->mnt_slave_list = old
1054  CLEAR_MNT_SHARED(mnt)
1055  Else if Not (flag & CL_PRIVATE) Then
1056  If flag & CL_MAKE_SHARED || IS_MNT_SHARED(old) Then list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
1058  If IS_MNT_SLAVE(old) Then list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
1060  slave is on master->mnt_slave_list = slave is on master->mnt_slave_list
1061  Else
1062  CLEAR_MNT_SHARED(mnt)
1064  If flag & CL_MAKE_SHARED Then set_mnt_shared(mnt)
1069  If flag & CL_EXPIRE Then
1070  If Not list_empty - tests whether a list is empty*@head: the list to test. Then list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
1074  Return mnt
1076  out_free :
1077  mnt_free_id(mnt)
1078  free_vfsmnt(mnt)
1079  Return ERR_PTR(err)
Caller
NameDescribe
mnt_clone_internal
copy_tree
clone_private_mountlone_private_mount - create a private clone of a path* This creates a new vfsmount, which will be the clone of @path. The new will* not be attached anywhere in the namespace and will be private (i.e. changes
__do_loopback