Lines Matching refs:progs

317 	for (atype = 0; atype < ARRAY_SIZE(cgrp->bpf.progs); atype++) {  in cgroup_bpf_release()
318 struct hlist_head *progs = &cgrp->bpf.progs[atype]; in cgroup_bpf_release() local
322 hlist_for_each_entry_safe(pl, pltmp, progs, node) { in cgroup_bpf_release()
418 cnt = prog_list_length(&p->bpf.progs[atype], NULL); in hierarchy_allows_attach()
438 struct bpf_prog_array *progs; in compute_effective_progs() local
446 cnt += prog_list_length(&p->bpf.progs[atype], &preorder_cnt); in compute_effective_progs()
450 progs = bpf_prog_array_alloc(cnt, GFP_KERNEL); in compute_effective_progs()
451 if (!progs) in compute_effective_progs()
464 hlist_for_each_entry(pl, &p->bpf.progs[atype], node) { in compute_effective_progs()
469 item = &progs->items[bstart]; in compute_effective_progs()
472 item = &progs->items[fstart]; in compute_effective_progs()
483 swap(progs->items[i], progs->items[j]); in compute_effective_progs()
487 *array = progs; in compute_effective_progs()
526 INIT_HLIST_HEAD(&cgrp->bpf.progs[i]); in cgroup_bpf_inherit()
623 static struct bpf_prog_list *find_attach_entry(struct hlist_head *progs, in find_attach_entry() argument
633 if (hlist_empty(progs)) in find_attach_entry()
635 return hlist_entry(progs->first, typeof(*pl), node); in find_attach_entry()
638 hlist_for_each_entry(pl, progs, node) { in find_attach_entry()
649 hlist_for_each_entry(pl, progs, node) { in find_attach_entry()
683 static struct bpf_prog_list *get_prog_list(struct hlist_head *progs, struct bpf_prog *prog, in get_prog_list() argument
701 } else if (!hlist_empty(progs)) { in get_prog_list()
722 hlist_for_each_entry(pltmp, progs, node) { in get_prog_list()
732 hlist_for_each_entry(pltmp, progs, node) { in get_prog_list()
751 static int insert_pl_to_hlist(struct bpf_prog_list *pl, struct hlist_head *progs, in insert_pl_to_hlist() argument
757 pltmp = get_prog_list(progs, prog, link, flags, id_or_fd); in insert_pl_to_hlist()
762 hlist_add_head(&pl->node, progs); in insert_pl_to_hlist()
799 struct hlist_head *progs; in __cgroup_bpf_attach() local
822 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_attach()
827 if (!hlist_empty(progs) && cgrp->bpf.flags[atype] != saved_flags) in __cgroup_bpf_attach()
834 if (prog_list_length(progs, NULL) >= BPF_CGROUP_MAX_PROGS) in __cgroup_bpf_attach()
837 pl = find_attach_entry(progs, prog, link, replace_prog, in __cgroup_bpf_attach()
855 err = insert_pl_to_hlist(pl, progs, prog, link, flags, id_or_fd); in __cgroup_bpf_attach()
931 struct bpf_prog_array *progs; in replace_effective_prog() local
948 head = &cg->bpf.progs[atype]; in replace_effective_prog()
959 progs = rcu_dereference_protected( in replace_effective_prog()
962 item = &progs->items[pos]; in replace_effective_prog()
984 struct hlist_head *progs; in __cgroup_bpf_replace() local
991 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_replace()
996 hlist_for_each_entry(pl, progs, node) { in __cgroup_bpf_replace()
1036 static struct bpf_prog_list *find_detach_entry(struct hlist_head *progs, in find_detach_entry() argument
1044 if (hlist_empty(progs)) in find_detach_entry()
1051 return hlist_entry(progs->first, typeof(*pl), node); in find_detach_entry()
1061 hlist_for_each_entry(pl, progs, node) { in find_detach_entry()
1083 struct bpf_prog_array *progs; in purge_effective_progs() local
1101 head = &cg->bpf.progs[atype]; in purge_effective_progs()
1114 progs = rcu_dereference_protected( in purge_effective_progs()
1119 WARN_ONCE(bpf_prog_array_delete_safe_at(progs, pos), in purge_effective_progs()
1143 struct hlist_head *progs; in __cgroup_bpf_detach() local
1159 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_detach()
1166 pl = find_detach_entry(progs, prog, link, flags & BPF_F_ALLOW_MULTI); in __cgroup_bpf_detach()
1187 if (hlist_empty(progs)) in __cgroup_bpf_detach()
1251 total_cnt += prog_list_length(&cgrp->bpf.progs[atype], NULL); in __cgroup_bpf_query()
1281 struct hlist_head *progs; in __cgroup_bpf_query() local
1286 progs = &cgrp->bpf.progs[atype]; in __cgroup_bpf_query()
1287 cnt = min_t(int, prog_list_length(progs, NULL), total_cnt); in __cgroup_bpf_query()
1289 hlist_for_each_entry(pl, progs, node) { in __cgroup_bpf_query()