Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:copy_cgroup_ns

Proto:struct cgroup_namespace *copy_cgroup_ns(unsigned long flags, struct user_namespace *user_ns, struct cgroup_namespace *old_ns)

Type:struct cgroup_namespace

Parameter:

TypeParameterName
unsigned longflags
struct user_namespace *user_ns
struct cgroup_namespace *old_ns
58  BUG_ON(!old_ns)
60  If Not (flags & New cgroup namespace ) Then
61  get_cgroup_ns(old_ns)
62  Return old_ns
66  If Not ns_capable(user_ns, Allow setting zone reclaim policy ) Then Return ERR_PTR( - EPERM)
69  ucounts = group namespaces
70  If Not ucounts Then Return ERR_PTR( - ENOSPC)
74  spin_lock_irq( & css_set_lock)
75  cset = ask_css_set - obtain a task's css_set*@task: the task to obtain css_set for* See task_css_set_check().
76  ed get/put for css_set objects
77  spin_unlock_irq( & css_set_lock)
79  new_ns = alloc_cgroup_ns()
80  If IS_ERR(new_ns) Then
81  put_css_set(cset)
82  dec_cgroup_namespaces(ucounts)
83  Return new_ns
86  user_ns = get_user_ns(user_ns)
87  ucounts = ucounts
88  root_cset = cset
90  Return new_ns