函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:The guts of cgroup1 mount - find or create cgroup_root to use

函数原型:static int cgroup1_root_to_use(struct fs_context *fc)

返回类型:int

参数:

类型参数名称
struct fs_context *fc
1115  ctx等于cgroup_fc2context(fc)
1121  ret等于check_cgroupfs_options(fc)
1122  如果ret则返回:ret
1133  如果非Selected subsystems 按位与1左移i位的值或 link to parent, protected by cgroup_lock() 恒等于The default hierarchy, reserved for the subsystems that are otherwise* unattached - it never has more than a single cgroup, and all tasks are* part of that cgroup.则继续下一循环
1137  如果非percpu_ref_tryget_live - try to increment a live percpu refcount*@ref: percpu_ref to try-get* Increment a percpu refcount unless it has already been killed则返回:1
1139  cgroup_put( & The root cgroup. Root is destroyed on its release. )
1142  rate across the hierarchies (root)
1143  bool name_match = false
1145  如果root恒等于The default hierarchy, reserved for the subsystems that are otherwise* unattached - it never has more than a single cgroup, and all tasks are* part of that cgroup.则继续下一循环
1153  如果Hierarchy name
1154  如果字符串比较则继续下一循环
1156  name_match = true
1165  如果非name_match则继续下一循环
1167  返回:负EBUSY
1170  如果 Hierarchy-specific flags 按位异或CGRP_ROOT_* flags 打印警告信息("new mount options do not match the existing superblock, will be ignored\n")
1173  root等于root
1174  返回:0
1182  如果非Selected subsystems 且非User explicitly requested empty subsystem 则返回:cg_invalf(fc, "cgroup1: No subsys list or none specified")
1186  如果ns不等于cgroup namespace for init task 则返回:负EPERM
1189  root等于分配内存并置零
1190  如果非root则返回:负ENOMEM
1193  root等于root
1194  init_cgroup_root(ctx)
1196  ret等于cgroup_setup_root(root, Selected subsystems )
1197  如果retcgroup_free_root(root)
1199  返回:ret
调用者
名称描述
cgroup1_get_tree