Lines Matching refs:progs

287 	for (atype = 0; atype < ARRAY_SIZE(cgrp->bpf.progs); atype++) {  in cgroup_bpf_release()
288 struct hlist_head *progs = &cgrp->bpf.progs[atype]; in cgroup_bpf_release() local
292 hlist_for_each_entry_safe(pl, pltmp, progs, node) { in cgroup_bpf_release()
386 cnt = prog_list_length(&p->bpf.progs[atype]); in hierarchy_allows_attach()
406 struct bpf_prog_array *progs; in compute_effective_progs() local
414 cnt += prog_list_length(&p->bpf.progs[atype]); in compute_effective_progs()
418 progs = bpf_prog_array_alloc(cnt, GFP_KERNEL); in compute_effective_progs()
419 if (!progs) in compute_effective_progs()
429 hlist_for_each_entry(pl, &p->bpf.progs[atype], node) { in compute_effective_progs()
433 item = &progs->items[cnt]; in compute_effective_progs()
441 *array = progs; in compute_effective_progs()
480 INIT_HLIST_HEAD(&cgrp->bpf.progs[i]); in cgroup_bpf_inherit()
556 static struct bpf_prog_list *find_attach_entry(struct hlist_head *progs, in find_attach_entry() argument
566 if (hlist_empty(progs)) in find_attach_entry()
568 return hlist_entry(progs->first, typeof(*pl), node); in find_attach_entry()
571 hlist_for_each_entry(pl, progs, node) { in find_attach_entry()
582 hlist_for_each_entry(pl, progs, node) { in find_attach_entry()
619 struct hlist_head *progs; in __cgroup_bpf_attach() local
637 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_attach()
642 if (!hlist_empty(progs) && cgrp->bpf.flags[atype] != saved_flags) in __cgroup_bpf_attach()
649 if (prog_list_length(progs) >= BPF_CGROUP_MAX_PROGS) in __cgroup_bpf_attach()
652 pl = find_attach_entry(progs, prog, link, replace_prog, in __cgroup_bpf_attach()
671 if (hlist_empty(progs)) in __cgroup_bpf_attach()
672 hlist_add_head(&pl->node, progs); in __cgroup_bpf_attach()
674 hlist_for_each(last, progs) { in __cgroup_bpf_attach()
747 struct bpf_prog_array *progs; in replace_effective_prog() local
764 head = &cg->bpf.progs[atype]; in replace_effective_prog()
775 progs = rcu_dereference_protected( in replace_effective_prog()
778 item = &progs->items[pos]; in replace_effective_prog()
800 struct hlist_head *progs; in __cgroup_bpf_replace() local
807 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_replace()
812 hlist_for_each_entry(pl, progs, node) { in __cgroup_bpf_replace()
851 static struct bpf_prog_list *find_detach_entry(struct hlist_head *progs, in find_detach_entry() argument
859 if (hlist_empty(progs)) in find_detach_entry()
866 return hlist_entry(progs->first, typeof(*pl), node); in find_detach_entry()
876 hlist_for_each_entry(pl, progs, node) { in find_detach_entry()
898 struct bpf_prog_array *progs; in purge_effective_progs() local
916 head = &cg->bpf.progs[atype]; in purge_effective_progs()
929 progs = rcu_dereference_protected( in purge_effective_progs()
934 WARN_ONCE(bpf_prog_array_delete_safe_at(progs, pos), in purge_effective_progs()
956 struct hlist_head *progs; in __cgroup_bpf_detach() local
969 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_detach()
976 pl = find_detach_entry(progs, prog, link, flags & BPF_F_ALLOW_MULTI); in __cgroup_bpf_detach()
996 if (hlist_empty(progs)) in __cgroup_bpf_detach()
1059 total_cnt += prog_list_length(&cgrp->bpf.progs[atype]); in __cgroup_bpf_query()
1085 struct hlist_head *progs; in __cgroup_bpf_query() local
1090 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_query()
1091 cnt = min_t(int, prog_list_length(progs), total_cnt); in __cgroup_bpf_query()
1093 hlist_for_each_entry(pl, progs, node) { in __cgroup_bpf_query()