Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__cgroup_bpf_detach() - Detach the program from a cgroup, and* propagate the change to descendants*@cgrp: The cgroup which descendants to traverse*@prog: A program to detach or NULL*@type: Type of detach operation* Must be called with cgroup_mutex held.

Proto:int __cgroup_bpf_detach(struct cgroup *cgrp, struct bpf_prog *prog, enum bpf_attach_type type)

Type:int

Parameter:

TypeParameterName
struct cgroup *cgrp
struct bpf_prog *prog
enum bpf_attach_typetype
430  progs = attached progs to this cgroup and attach flags * when flags == 0 or BPF_F_ALLOW_OVERRIDE the progs list will * have either zero or one element * when BPF_F_ALLOW_MULTI the list can have up to BPF_CGROUP_MAX_PROGS[type]
432  flags = flags[type]
433  struct bpf_prog * old_prog = NULL
437  If flags & BPF_F_ALLOW_MULTI Then
438  If Not prog Then Return -EINVAL
443  Else
444  If list_empty - tests whether a list is empty*@head: the list to test. Then Return -ENOENT
449  If flags & BPF_F_ALLOW_MULTI Then
452  If prog != prog Then Continue
454  old_prog = prog
458  prog = NULL
459  Break
461  If Not old_prog Then Return -ENOENT
463  Else
467  pl = list_first_entry - get the first element from a list*@ptr: the list head to take the element from.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.* Note, that list is expected to be not empty.(progs, typeof( * pl), node)
468  old_prog = prog
469  prog = NULL
472  err = update_effective_progs(cgrp, type)
473  If err Then Go to cleanup
477  deletes entry from list
479  bpf_cgroup_storage_unlink(storage[stype])
480  bpf_cgroup_storage_free(storage[stype])
482  kfree(pl)
483  If list_empty - tests whether a list is empty*@head: the list to test. Then flags[type] = 0
487  bpf_prog_put(old_prog)
488  static_branch_dec( & cgroup_bpf_enabled_key)
489  Return 0
491  cleanup :
493  prog = old_prog
494  Return err