Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:alloc_mnt_ns

Proto:static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns, bool anon)

Type:struct mnt_namespace

Parameter:

TypeParameterName
struct user_namespace *user_ns
boolanon
3183  ucounts = inc_mnt_namespaces(user_ns)
3184  If Not ucounts Then Return ERR_PTR( - ENOSPC)
3187  new_ns = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
3188  If Not new_ns Then
3189  dec_mnt_namespaces(ucounts)
3190  Return ERR_PTR( - ENOMEM)
3192  If Not anon Then
3193  ret = ns_alloc_inum( & ns)
3194  If ret Then
3195  kfree(new_ns)
3197  Return ERR_PTR(ret)
3200  ops = mntns_operations
3201  If Not anon Then Sequence number to prevent loops = atomic64_add_return(1, & Assign a sequence number so we can detect when we attempt to bind* mount a reference to an older mount namespace into the current* mount namespace, preventing reference counting loops)
3203  atomic_set( & count, 1)
3204  Initialization list head
3205  init_waitqueue_head( & poll)
3206  user_ns = get_user_ns(user_ns)
3207  ucounts = ucounts
3208  Return new_ns
Caller
NameDescribe
open_detached_copy
copy_mnt_ns
mount_subtree
SYSCALL_DEFINE3Create a kernel mount representation for a new, prepared superblock* (specified by fs_fd) and attach to an open_tree-like file descriptor.
init_mount_tree