函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:mpute a chain of effective programs for a given cgroup:* start from the list of programs in this cgroup and add* all parent programs.* Note that parent's F_ALLOW_OVERRIDE-type program is yielding* to programs in this cgroup

函数原型:static int compute_effective_progs(struct cgroup *cgrp, enum bpf_attach_type type, struct bpf_prog_array **array)

返回类型:int

参数:

类型参数名称
struct cgroup *cgrp
enum bpf_attach_typetype
struct bpf_prog_array **array
145  p等于cgrp
146  cnt等于0
149  循环
150  如果cnt恒等于0或flags[type]按位与BPF_F_ALLOW_MULTIcnt加等于 number of elements in the list.* it's slow but the list cannot be long
152  p等于cgroup_parent(p)
153 p循环
155  progs等于bpf_prog_array_alloc(cnt, GFP_KERNEL)
156  如果非progs则返回:负ENOMEM
160  cnt等于0
161  p等于cgrp
162  循环
163  如果cnt大于0且非flags[type]按位与BPF_F_ALLOW_MULTI的值则继续下一循环
167  如果非prog则继续下一循环
170  prog等于prog
171  for_each_cgroup_storage_type(stype)
172  cgroup_storage[stype]等于storage[stype]
174  cnt自加
176 p等于cgroup_parent(p)循环
178  array等于progs
179  返回:0
调用者
名称描述
cgroup_bpf_inheritgroup_bpf_inherit() - inherit effective programs from parent*@cgrp: the cgroup to modify
update_effective_progs