Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:static int compute_effective_progs(struct cgroup *cgrp, enum bpf_attach_type type, struct bpf_prog_array **array)

Type:int

Parameter:

TypeParameterName
struct cgroup *cgrp
enum bpf_attach_typetype
struct bpf_prog_array **array
145  p = cgrp
146  cnt = 0
149  Do
150  If cnt == 0 || flags[type] & BPF_F_ALLOW_MULTI Then cnt += number of elements in the list.* it's slow but the list cannot be long
152  p = cgroup_parent(p)
153  When p cycle
155  progs = bpf_prog_array_alloc(cnt, GFP_KERNEL)
156  If Not progs Then Return -ENOMEM
160  cnt = 0
161  p = cgrp
162  Do
163  If cnt > 0 && Not (flags[type] & BPF_F_ALLOW_MULTI) Then Continue
167  If Not prog Then Continue
170  prog = prog
171  for_each_cgroup_storage_type(stype)
172  cgroup_storage[stype] = storage[stype]
174  cnt++
176  When p = cgroup_parent(p) cycle
178  array = progs
179  Return 0
Caller
NameDescribe
cgroup_bpf_inheritgroup_bpf_inherit() - inherit effective programs from parent*@cgrp: the cgroup to modify
update_effective_progs