函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:hange the enabled child controllers for a cgroup in the default hierarchy

函数原型:static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off)

返回类型:ssize_t

参数:

类型参数名称
struct kernfs_open_file *of
char *buf
size_tnbytes
loff_toff
3222  enable等于0, disable等于0
3232  buf等于strstrip(buf)
3233 tok等于分割字符串循环
3234  如果tok[0]恒等于'\0'则继续下一循环
3236  循环
3236  如果非CGROUP_SUBSYS_COUNT
3236  ssid等于0
3236  退出
3236  ss等于cgroup_subsys[ssid]
3241  如果tok恒等于'+'则
3242  enable或等于1左移ssid
3243  disable与等于1左移ssid位的值的反
3244  否则如果tok恒等于'-'则
3245  disable或等于1左移ssid
3246  enable与等于1左移ssid位的值的反
3247  否则
3248  返回:负EINVAL
3250  退出
3251  当(false)循环
3252  如果ssid恒等于CGROUP_SUBSYS_COUNT则返回:负EINVAL
3256  cgrp等于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
3257  如果非cgrp则返回:负ENODEV
3261  如果enable按位与1左移ssid位则
3263  enable与等于1左移ssid位的值的反
3264  继续下一循环
3267  如果非subsystems visibly enabled on a cgroup 按位与1左移ssid位的值则
3268  ret等于负ENOENT
3269  转到:out_unlock
3271  否则如果disable按位与1左移ssid位则
3273  disable与等于1左移ssid位的值的反
3274  继续下一循环
3280  ret等于负EBUSY
3281  转到:out_unlock
3287  如果非enable且非disable
3288  ret等于0
3289  转到:out_unlock
3292  ret等于cgroup_vet_subtree_control_enable(cgrp, enable)
3293  如果ret则转到:out_unlock
3297  group_save_control - save control masks and dom_cgrp of a subtree*@cgrp: root of the target subtree* Save ->subtree_control, ->subtree_ss_mask and ->dom_cgrp to the* respective old_ prefixed fields for @cgrp's subtree including @cgrp* itself.
3299  * The bitmask of subsystems enabled on the child cgroups. * ->subtree_control is the one configured through * "cgroup.subtree_control" while ->child_ss_mask is the effective * one which may have more subsystems enabled. Controller knobs * are made availabl或等于enable
3300  * The bitmask of subsystems enabled on the child cgroups. * ->subtree_control is the one configured through * "cgroup.subtree_control" while ->child_ss_mask is the effective * one which may have more subsystems enabled. Controller knobs * are made availabl与等于disable的反
3302  ret等于cgroup_apply_control(cgrp)
3303  cgroup_finalize_control(cgrp, ret)
3304  如果ret则转到:out_unlock
3307  kernfs_activate( cgroup kernfs entry )
3308  out_unlock :
3309  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
3310  返回:如果ret否则nbytes