Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:cgroup_mkdir

Proto:int cgroup_mkdir(struct kernfs_node *parent_kn, const char *name, umode_t mode)

Type:int

Parameter:

TypeParameterName
struct kernfs_node *parent_kn
const char *name
umode_tmode
5296  If strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for Then Return -EINVAL
5299  parent = group_kn_lock_live - locking helper for cgroup kernfs methods*@kn: the kernfs_node being serviced*@drain_offline: perform offline draining on the cgroup* This helper is to be used by a cgroup kernfs method currently servicing*@kn
5300  If Not parent Then Return -ENODEV
5303  If Not cgroup_check_hierarchy_limits(parent) Then
5304  ret = -EAGAIN
5305  Go to out_unlock
5308  cgrp = The returned cgroup is fully initialized including its control mask, but* it isn't associated with its kernfs_node and doesn't have the control* mask applied.
5309  If IS_ERR(cgrp) Then
5310  ret = PTR_ERR(cgrp)
5311  Go to out_unlock
5318  kernfs_get( cgroup kernfs entry )
5320  ret = set uid and gid of cgroup dirs and files to that of the creator
5321  If ret Then Go to out_destroy
5324  ret = ss_populate_dir - create subsys files in a cgroup directory*@css: target css* On failure, no file is added.
5325  If ret Then Go to out_destroy
5328  ret = group_apply_control_enable - enable or show csses according to control*@cgrp: root of the target subtree* Walk @cgrp's subtree and create new csses or make the existing ones* visible. A css is created invisible if it's being implicitly enabled
5329  If ret Then Go to out_destroy
5332  cgroup_path() takes a spin lock(mkdir, cgrp)
5335  kernfs_activate( cgroup kernfs entry )
5337  ret = 0
5338  Go to out_unlock
5340  out_destroy :
5341  group_destroy_locked - the first stage of cgroup destruction*@cgrp: cgroup to be destroyed* css's make use of percpu refcnts whose killing latency shouldn't be* exposed to userland and are RCU protected
5342  out_unlock :
5343  group_kn_unlock - unlocking helper for cgroup kernfs methods*@kn: the kernfs_node being serviced* This helper undoes cgroup_kn_lock_live() and should be invoked before* the method finishes if locking succeeded
5344  Return ret