函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:blkcg_css_alloc

函数原型:static struct cgroup_subsys_state *blkcg_css_alloc(struct cgroup_subsys_state *parent_css)

返回类型:struct cgroup_subsys_state

参数:

类型参数名称
struct cgroup_subsys_state *parent_css
948  mutex_lock( & blkcg_pol_mutex)
950  如果非parent_css
951  blkcg等于blkcg_root
952  否则
953  blkcg等于分配内存并置零
954  如果非blkcg
955  ret等于错误号
956  转到:unlock
960 i小于Maximum number of blkcg policies allowed to be registered concurrently.* Defined here to simplify include dependency.循环
961  pol等于blkcg_policy[i]
970  如果非pol或非 operations 则继续下一循环
973  cpd等于 operations (GFP_KERNEL)
974  如果非cpd
975  ret等于错误号
976  转到:free_pd_blkcg
978  cpd[i]等于cpd
979  the blkcg and policy id this per-policy data belongs to 等于blkcg
980  plid等于i
981  如果cpd_init_fncpd_init_fn(cpd)
985  spin_lock_init( & lock)
986  INIT_RADIX_TREE( & blkg_tree, GFP_NOWAIT | DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.)
987  INIT_HLIST_HEAD( & blkg_list)
992  添加链表项
994  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
995  返回:css
997  free_pd_blkcg :
998 i大于等于0循环如果cpd[i]则
1000  cpd_free_fn(cpd[i])
1002  如果blkcg不等于blkcg_root释放内存
1004  unlock :
1005  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1006  返回:ret