函数逻辑报告 |
Source Code:kernel\bpf\cgroup.c |
Create Date:2022-07-27 14:46:06 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:__cgroup_bpf_attach() - Attach the program to a cgroup, and* propagate the change to descendants*@cgrp: The cgroup which descendants to traverse*@prog: A program to attach*@type: Type of attach operation*@flags: Option flags
函数原型:int __cgroup_bpf_attach(struct cgroup *cgrp, struct bpf_prog *prog, enum bpf_attach_type type, u32 flags)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct cgroup * | cgrp | |
struct bpf_prog * | prog | |
enum bpf_attach_type | type | |
u32 | flags |
303 | struct bpf_cgroup_storage * storage[__BPF_CGROUP_STORAGE_MAX], * old_storage[__BPF_CGROUP_STORAGE_MAX] = {NULL} |
310 | 如果flags按位与cgroup-bpf attach flags used in BPF_PROG_ATTACH command* NONE(default): No further bpf programs allowed in the subtree且flags按位与BPF_F_ALLOW_MULTI则返回:负EINVAL |
314 | 如果非 parent has non-overridable prog attached,* disallow attaching new programs to the descendent cgroup.* if parent has overridable or multi-prog, allow attaching则返回:负EPERM |
324 | 如果 number of elements in the list.* it's slow but the list cannot be long大于等于BPF_CGROUP_MAX_PROGS则返回:负E2BIG |
328 | storage[stype]等于bpf_cgroup_storage_alloc(prog, stype) |
329 | 如果是错误则 |
333 | 返回:负ENOMEM |
337 | 如果flags按位与BPF_F_ALLOW_MULTI则 |
348 | 如果非pl则 |
354 | pl_was_allocated = true |
358 | 添加链表项 |
359 | 否则 |
360 | 如果链表为空则 |
369 | 否则 |
373 | old_storage[stype]等于storage[stype] |
376 | pl_was_allocated = false |
385 | err等于update_effective_progs(cgrp, type) |
391 | 如果非old_storage[stype]则继续下一循环 |
395 | 如果old_prog则 |
396 | bpf_prog_put(old_prog) |
400 | bpf_cgroup_storage_link(storage[stype], cgrp, type) |
401 | 返回:0 |
403 | cleanup : |
408 | storage[stype]等于old_storage[stype] |
409 | bpf_cgroup_storage_link(old_storage[stype], cgrp, type) |
411 | 如果pl_was_allocated则 |
415 | 返回:err |
名称 | 描述 |
---|---|
cgroup_bpf_attach | sock->sk_cgrp_data handling. For more info, see sock_cgroup_data* definition in cgroup-defs.h. |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |