Lines Matching full:pl
139 struct bpf_prog_list *pl, *pltmp; in cgroup_bpf_release() local
141 list_for_each_entry_safe(pl, pltmp, progs, node) { in cgroup_bpf_release()
142 list_del(&pl->node); in cgroup_bpf_release()
143 if (pl->prog) in cgroup_bpf_release()
144 bpf_prog_put(pl->prog); in cgroup_bpf_release()
145 if (pl->link) in cgroup_bpf_release()
146 bpf_cgroup_link_auto_detach(pl->link); in cgroup_bpf_release()
147 kfree(pl); in cgroup_bpf_release()
186 static struct bpf_prog *prog_list_prog(struct bpf_prog_list *pl) in prog_list_prog() argument
188 if (pl->prog) in prog_list_prog()
189 return pl->prog; in prog_list_prog()
190 if (pl->link) in prog_list_prog()
191 return pl->link->link.prog; in prog_list_prog()
200 struct bpf_prog_list *pl; in prog_list_length() local
203 list_for_each_entry(pl, head, node) { in prog_list_length()
204 if (!prog_list_prog(pl)) in prog_list_length()
250 struct bpf_prog_list *pl; in compute_effective_progs() local
272 list_for_each_entry(pl, &p->bpf.progs[type], node) { in compute_effective_progs()
273 if (!prog_list_prog(pl)) in compute_effective_progs()
277 item->prog = prog_list_prog(pl); in compute_effective_progs()
279 pl->storage); in compute_effective_progs()
405 struct bpf_prog_list *pl; in find_attach_entry() local
411 return list_first_entry(progs, typeof(*pl), node); in find_attach_entry()
414 list_for_each_entry(pl, progs, node) { in find_attach_entry()
415 if (prog && pl->prog == prog && prog != replace_prog) in find_attach_entry()
418 if (link && pl->link == link) in find_attach_entry()
425 list_for_each_entry(pl, progs, node) { in find_attach_entry()
426 if (pl->prog == replace_prog) in find_attach_entry()
428 return pl; in find_attach_entry()
460 struct bpf_prog_list *pl; in __cgroup_bpf_attach() local
487 pl = find_attach_entry(progs, prog, link, replace_prog, in __cgroup_bpf_attach()
489 if (IS_ERR(pl)) in __cgroup_bpf_attach()
490 return PTR_ERR(pl); in __cgroup_bpf_attach()
496 if (pl) { in __cgroup_bpf_attach()
497 old_prog = pl->prog; in __cgroup_bpf_attach()
499 pl = kmalloc(sizeof(*pl), GFP_KERNEL); in __cgroup_bpf_attach()
500 if (!pl) { in __cgroup_bpf_attach()
504 list_add_tail(&pl->node, progs); in __cgroup_bpf_attach()
507 pl->prog = prog; in __cgroup_bpf_attach()
508 pl->link = link; in __cgroup_bpf_attach()
509 bpf_cgroup_storages_assign(pl->storage, storage); in __cgroup_bpf_attach()
525 pl->prog = old_prog; in __cgroup_bpf_attach()
526 pl->link = NULL; in __cgroup_bpf_attach()
530 list_del(&pl->node); in __cgroup_bpf_attach()
531 kfree(pl); in __cgroup_bpf_attach()
546 struct bpf_prog_list *pl; in replace_effective_prog() local
563 list_for_each_entry(pl, head, node) { in replace_effective_prog()
564 if (!prog_list_prog(pl)) in replace_effective_prog()
566 if (pl->link == link) in replace_effective_prog()
596 struct bpf_prog_list *pl; in __cgroup_bpf_replace() local
602 list_for_each_entry(pl, progs, node) { in __cgroup_bpf_replace()
603 if (pl->link == link) { in __cgroup_bpf_replace()
646 struct bpf_prog_list *pl; in find_detach_entry() local
656 return list_first_entry(progs, typeof(*pl), node); in find_detach_entry()
666 list_for_each_entry(pl, progs, node) { in find_detach_entry()
667 if (pl->prog == prog && pl->link == link) in find_detach_entry()
668 return pl; in find_detach_entry()
689 struct bpf_prog_list *pl; in purge_effective_progs() local
707 list_for_each_entry(pl, head, node) { in purge_effective_progs()
708 if (!prog_list_prog(pl)) in purge_effective_progs()
710 if (pl->prog == prog && pl->link == link) in purge_effective_progs()
745 struct bpf_prog_list *pl; in __cgroup_bpf_detach() local
752 pl = find_detach_entry(progs, prog, link, flags & BPF_F_ALLOW_MULTI); in __cgroup_bpf_detach()
753 if (IS_ERR(pl)) in __cgroup_bpf_detach()
754 return PTR_ERR(pl); in __cgroup_bpf_detach()
757 old_prog = pl->prog; in __cgroup_bpf_detach()
758 pl->prog = NULL; in __cgroup_bpf_detach()
759 pl->link = NULL; in __cgroup_bpf_detach()
763 pl->prog = old_prog; in __cgroup_bpf_detach()
764 pl->link = link; in __cgroup_bpf_detach()
769 list_del(&pl->node); in __cgroup_bpf_detach()
770 kfree(pl); in __cgroup_bpf_detach()
815 struct bpf_prog_list *pl; in __cgroup_bpf_query() local
819 list_for_each_entry(pl, progs, node) { in __cgroup_bpf_query()
820 prog = prog_list_prog(pl); in __cgroup_bpf_query()