Lines Matching refs:progs

120 	for (atype = 0; atype < ARRAY_SIZE(cgrp->bpf.progs); atype++) {  in cgroup_bpf_release()
121 struct list_head *progs = &cgrp->bpf.progs[atype]; in cgroup_bpf_release() local
124 list_for_each_entry_safe(pl, pltmp, progs, node) { in cgroup_bpf_release()
212 cnt = prog_list_length(&p->bpf.progs[atype]); in hierarchy_allows_attach()
232 struct bpf_prog_array *progs; in compute_effective_progs() local
240 cnt += prog_list_length(&p->bpf.progs[atype]); in compute_effective_progs()
244 progs = bpf_prog_array_alloc(cnt, GFP_KERNEL); in compute_effective_progs()
245 if (!progs) in compute_effective_progs()
255 list_for_each_entry(pl, &p->bpf.progs[atype], node) { in compute_effective_progs()
259 item = &progs->items[cnt]; in compute_effective_progs()
267 *array = progs; in compute_effective_progs()
306 INIT_LIST_HEAD(&cgrp->bpf.progs[i]); in cgroup_bpf_inherit()
382 static struct bpf_prog_list *find_attach_entry(struct list_head *progs, in find_attach_entry() argument
392 if (list_empty(progs)) in find_attach_entry()
394 return list_first_entry(progs, typeof(*pl), node); in find_attach_entry()
397 list_for_each_entry(pl, progs, node) { in find_attach_entry()
408 list_for_each_entry(pl, progs, node) { in find_attach_entry()
444 struct list_head *progs; in __cgroup_bpf_attach() local
462 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_attach()
467 if (!list_empty(progs) && cgrp->bpf.flags[atype] != saved_flags) in __cgroup_bpf_attach()
474 if (prog_list_length(progs) >= BPF_CGROUP_MAX_PROGS) in __cgroup_bpf_attach()
477 pl = find_attach_entry(progs, prog, link, replace_prog, in __cgroup_bpf_attach()
494 list_add_tail(&pl->node, progs); in __cgroup_bpf_attach()
549 struct bpf_prog_array *progs; in replace_effective_prog() local
566 head = &cg->bpf.progs[atype]; in replace_effective_prog()
577 progs = rcu_dereference_protected( in replace_effective_prog()
580 item = &progs->items[pos]; in replace_effective_prog()
601 struct list_head *progs; in __cgroup_bpf_replace() local
608 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_replace()
613 list_for_each_entry(pl, progs, node) { in __cgroup_bpf_replace()
652 static struct bpf_prog_list *find_detach_entry(struct list_head *progs, in find_detach_entry() argument
660 if (list_empty(progs)) in find_detach_entry()
667 return list_first_entry(progs, typeof(*pl), node); in find_detach_entry()
677 list_for_each_entry(pl, progs, node) { in find_detach_entry()
701 struct list_head *progs; in __cgroup_bpf_detach() local
709 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_detach()
716 pl = find_detach_entry(progs, prog, link, flags & BPF_F_ALLOW_MULTI); in __cgroup_bpf_detach()
732 if (list_empty(progs)) in __cgroup_bpf_detach()
766 struct list_head *progs; in __cgroup_bpf_query() local
775 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_query()
784 cnt = prog_list_length(progs); in __cgroup_bpf_query()
805 list_for_each_entry(pl, progs, node) { in __cgroup_bpf_query()