Lines Matching full:pl

122 		struct bpf_prog_list *pl, *pltmp;  in cgroup_bpf_release()  local
124 list_for_each_entry_safe(pl, pltmp, progs, node) { in cgroup_bpf_release()
125 list_del(&pl->node); in cgroup_bpf_release()
126 if (pl->prog) in cgroup_bpf_release()
127 bpf_prog_put(pl->prog); in cgroup_bpf_release()
128 if (pl->link) in cgroup_bpf_release()
129 bpf_cgroup_link_auto_detach(pl->link); in cgroup_bpf_release()
130 kfree(pl); in cgroup_bpf_release()
169 static struct bpf_prog *prog_list_prog(struct bpf_prog_list *pl) in prog_list_prog() argument
171 if (pl->prog) in prog_list_prog()
172 return pl->prog; in prog_list_prog()
173 if (pl->link) in prog_list_prog()
174 return pl->link->link.prog; in prog_list_prog()
183 struct bpf_prog_list *pl; in prog_list_length() local
186 list_for_each_entry(pl, head, node) { in prog_list_length()
187 if (!prog_list_prog(pl)) in prog_list_length()
233 struct bpf_prog_list *pl; in compute_effective_progs() local
255 list_for_each_entry(pl, &p->bpf.progs[atype], node) { in compute_effective_progs()
256 if (!prog_list_prog(pl)) in compute_effective_progs()
260 item->prog = prog_list_prog(pl); in compute_effective_progs()
262 pl->storage); in compute_effective_progs()
388 struct bpf_prog_list *pl; in find_attach_entry() local
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()
398 if (prog && pl->prog == prog && prog != replace_prog) in find_attach_entry()
401 if (link && pl->link == link) in find_attach_entry()
408 list_for_each_entry(pl, progs, node) { in find_attach_entry()
409 if (pl->prog == replace_prog) in find_attach_entry()
411 return pl; in find_attach_entry()
443 struct bpf_prog_list *pl; in __cgroup_bpf_attach() local
477 pl = find_attach_entry(progs, prog, link, replace_prog, in __cgroup_bpf_attach()
479 if (IS_ERR(pl)) in __cgroup_bpf_attach()
480 return PTR_ERR(pl); in __cgroup_bpf_attach()
486 if (pl) { in __cgroup_bpf_attach()
487 old_prog = pl->prog; in __cgroup_bpf_attach()
489 pl = kmalloc(sizeof(*pl), GFP_KERNEL); in __cgroup_bpf_attach()
490 if (!pl) { in __cgroup_bpf_attach()
494 list_add_tail(&pl->node, progs); in __cgroup_bpf_attach()
497 pl->prog = prog; in __cgroup_bpf_attach()
498 pl->link = link; in __cgroup_bpf_attach()
499 bpf_cgroup_storages_assign(pl->storage, storage); in __cgroup_bpf_attach()
515 pl->prog = old_prog; in __cgroup_bpf_attach()
516 pl->link = NULL; in __cgroup_bpf_attach()
520 list_del(&pl->node); in __cgroup_bpf_attach()
521 kfree(pl); in __cgroup_bpf_attach()
536 struct bpf_prog_list *pl; in replace_effective_prog() local
553 list_for_each_entry(pl, head, node) { in replace_effective_prog()
554 if (!prog_list_prog(pl)) in replace_effective_prog()
556 if (pl->link == link) in replace_effective_prog()
586 struct bpf_prog_list *pl; in __cgroup_bpf_replace() local
599 list_for_each_entry(pl, progs, node) { in __cgroup_bpf_replace()
600 if (pl->link == link) { in __cgroup_bpf_replace()
643 struct bpf_prog_list *pl; in find_detach_entry() local
653 return list_first_entry(progs, typeof(*pl), node); in find_detach_entry()
663 list_for_each_entry(pl, progs, node) { in find_detach_entry()
664 if (pl->prog == prog && pl->link == link) in find_detach_entry()
665 return pl; in find_detach_entry()
686 struct bpf_prog_list *pl; in __cgroup_bpf_detach() local
702 pl = find_detach_entry(progs, prog, link, flags & BPF_F_ALLOW_MULTI); in __cgroup_bpf_detach()
703 if (IS_ERR(pl)) in __cgroup_bpf_detach()
704 return PTR_ERR(pl); in __cgroup_bpf_detach()
707 old_prog = pl->prog; in __cgroup_bpf_detach()
708 pl->prog = NULL; in __cgroup_bpf_detach()
709 pl->link = NULL; in __cgroup_bpf_detach()
716 list_del(&pl->node); in __cgroup_bpf_detach()
717 kfree(pl); in __cgroup_bpf_detach()
728 pl->prog = old_prog; in __cgroup_bpf_detach()
729 pl->link = link; in __cgroup_bpf_detach()
776 struct bpf_prog_list *pl; in __cgroup_bpf_query() local
780 list_for_each_entry(pl, progs, node) { in __cgroup_bpf_query()
781 prog = prog_list_prog(pl); in __cgroup_bpf_query()