函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:copy_cgroup_ns

函数原型:struct cgroup_namespace *copy_cgroup_ns(unsigned long flags, struct user_namespace *user_ns, struct cgroup_namespace *old_ns)

返回类型:struct cgroup_namespace

参数:

类型参数名称
unsigned longflags
struct user_namespace *user_ns
struct cgroup_namespace *old_ns
58  BUG_ON(!old_ns)
60  如果非flags按位与New cgroup namespace 的值则
61  get_cgroup_ns(old_ns)
62  返回:old_ns
66  如果非ns_capable(user_ns, Allow setting zone reclaim policy )则返回:错误号
69  ucounts等于group namespaces
70  如果非ucounts则返回:错误号
74  spin_lock_irq( & css_set_lock)
75  cset等于获得任务的css_set
76  ed get/put for css_set objects
77  spin_unlock_irq( & css_set_lock)
79  new_ns等于alloc_cgroup_ns()
80  如果是错误
81  put_css_set(cset)
82  dec_cgroup_namespaces(ucounts)
83  返回:new_ns
86  user_ns等于get_user_ns(user_ns)
87  ucounts等于ucounts
88  root_cset等于cset
90  返回:new_ns
调用者
名称描述
create_new_namespacesCreate new nsproxy and all of its the associated namespaces.* Return the newly created nsproxy. Do not attach this to the task,* leave it to the caller to do proper locking and attach it to task.