函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:alloc_mnt_ns

函数原型:static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns, bool anon)

返回类型:struct mnt_namespace

参数:

类型参数名称
struct user_namespace *user_ns
boolanon
3183  ucounts等于inc_mnt_namespaces(user_ns)
3184  如果非ucounts则返回:错误号
3187  new_ns等于分配内存并置零
3188  如果非new_ns
3189  dec_mnt_namespaces(ucounts)
3190  返回:错误号
3192  如果非anon
3193  ret等于ns_alloc_inum( & ns)
3194  如果ret
3195  释放内存
3197  返回:错误号
3200  ops等于mntns_operations
3201  如果非anon 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  初始化链表头
3205  init_waitqueue_head( & poll)
3206  user_ns等于get_user_ns(user_ns)
3207  ucounts等于ucounts
3208  返回:new_ns
调用者
名称描述
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