函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\pid_namespace.c Create Date:2022-07-27 12:22:57
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:create_pid_namespace

函数原型:static struct pid_namespace *create_pid_namespace(struct user_namespace *user_ns, struct pid_namespace *parent_pid_ns)

返回类型:struct pid_namespace

参数:

类型参数名称
struct user_namespace *user_ns
struct pid_namespace *parent_pid_ns
80  level等于进程级别加1
84  err等于负EINVAL
85  如果非Returns true if @child is the same namespace or a descendant of*@ancestor.则转到:out
88  err等于负ENOSPC
89  如果level大于MAX_PID_NS_LEVEL is needed for limiting size of 'struct pid' 则转到:out
91  ucounts等于inc_pid_namespaces(user_ns)
92  如果非ucounts则转到:out
95  err等于负ENOMEM
96  ns等于Shortcuts
97  如果(ns == NULL)则转到:out_dec
100  dr_init() - Initialise an IDR.*@idr: IDR handle.* Initialise a dynamically allocated IDR. To initialise a* statically allocated IDR, use DEFINE_IDR().
102  分配pid的slab的地址等于reates the kmem cache to allocate pids from.*@level: pid namespace level
103  如果(分配pid的slab的地址 == NULL)则转到:out_free_idr
106  err等于ns_alloc_inum( & ns)
107  如果err则转到:out_free_idr
109  ops等于pidns_operations
111  初始化对象
112  进程级别等于level
113  父进程空间等于get_pid_ns(parent_pid_ns)
114  user_ns等于get_user_ns(user_ns)
115  ucounts等于ucounts
116  pid_allocated等于PIDNS_ADDING
117  INIT_WORK( & proc_work, proc_cleanup_work)
119  返回:ns
121  out_free_idr :
122  dr_destroy - release all internal memory from an IDR*@idr: idr handle* After this function is called, the IDR is empty, and may be reused or* the data structure containing it may be freed
123  kmem_cache_free(pid_ns_cachep, ns)
124  out_dec :
125  dec_pid_namespaces(ucounts)
126  out :
127  返回:错误号
调用者
名称描述
copy_pid_ns