Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:create_pid_namespace

Proto:static struct pid_namespace *create_pid_namespace(struct user_namespace *user_ns, struct pid_namespace *parent_pid_ns)

Type:struct pid_namespace

Parameter:

TypeParameterName
struct user_namespace *user_ns
struct pid_namespace *parent_pid_ns
80  level = level + 1
84  err = -EINVAL
85  If Not Returns true if @child is the same namespace or a descendant of*@ancestor. Then Go to out
88  err = -ENOSPC
89  If level > MAX_PID_NS_LEVEL is needed for limiting size of 'struct pid' Then Go to out
91  ucounts = inc_pid_namespaces(user_ns)
92  If Not ucounts Then Go to out
95  err = -ENOMEM
96  ns = Shortcuts
97  If (ns == NULL) Then Go to 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_cachep = reates the kmem cache to allocate pids from.*@level: pid namespace level
103  If (pid_cachep == NULL) Then Go to out_free_idr
106  err = ns_alloc_inum( & ns)
107  If err Then Go to out_free_idr
109  ops = pidns_operations
111  kref_init - initialize object.*@kref: object in question.
112  level = level
113  parent = 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  Return 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 - Deallocate an object*@cachep: The cache the allocation was from.*@objp: The previously allocated object.* Free an object which was previously allocated from this* cache.
124  out_dec :
125  dec_pid_namespaces(ucounts)
126  out :
127  Return ERR_PTR(err)
Caller
NameDescribe
copy_pid_ns