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[type], 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
470 pl = find_attach_entry(progs, prog, link, replace_prog, in __cgroup_bpf_attach()
472 if (IS_ERR(pl)) in __cgroup_bpf_attach()
473 return PTR_ERR(pl); in __cgroup_bpf_attach()
479 if (pl) { in __cgroup_bpf_attach()
480 old_prog = pl->prog; in __cgroup_bpf_attach()
482 pl = kmalloc(sizeof(*pl), GFP_KERNEL); in __cgroup_bpf_attach()
483 if (!pl) { in __cgroup_bpf_attach()
487 list_add_tail(&pl->node, progs); in __cgroup_bpf_attach()
490 pl->prog = prog; in __cgroup_bpf_attach()
491 pl->link = link; in __cgroup_bpf_attach()
492 bpf_cgroup_storages_assign(pl->storage, storage); in __cgroup_bpf_attach()
508 pl->prog = old_prog; in __cgroup_bpf_attach()
509 pl->link = NULL; in __cgroup_bpf_attach()
513 list_del(&pl->node); in __cgroup_bpf_attach()
514 kfree(pl); in __cgroup_bpf_attach()
529 struct bpf_prog_list *pl; in replace_effective_prog() local
546 list_for_each_entry(pl, head, node) { in replace_effective_prog()
547 if (!prog_list_prog(pl)) in replace_effective_prog()
549 if (pl->link == link) in replace_effective_prog()
579 struct bpf_prog_list *pl; in __cgroup_bpf_replace() local
585 list_for_each_entry(pl, progs, node) { in __cgroup_bpf_replace()
586 if (pl->link == link) { in __cgroup_bpf_replace()
629 struct bpf_prog_list *pl; in find_detach_entry() local
639 return list_first_entry(progs, typeof(*pl), node); in find_detach_entry()
649 list_for_each_entry(pl, progs, node) { in find_detach_entry()
650 if (pl->prog == prog && pl->link == link) in find_detach_entry()
651 return pl; in find_detach_entry()
672 struct bpf_prog_list *pl; in __cgroup_bpf_detach() local
680 pl = find_detach_entry(progs, prog, link, flags & BPF_F_ALLOW_MULTI); in __cgroup_bpf_detach()
681 if (IS_ERR(pl)) in __cgroup_bpf_detach()
682 return PTR_ERR(pl); in __cgroup_bpf_detach()
685 old_prog = pl->prog; in __cgroup_bpf_detach()
686 pl->prog = NULL; in __cgroup_bpf_detach()
687 pl->link = NULL; in __cgroup_bpf_detach()
694 list_del(&pl->node); in __cgroup_bpf_detach()
695 kfree(pl); in __cgroup_bpf_detach()
706 pl->prog = old_prog; in __cgroup_bpf_detach()
707 pl->link = link; in __cgroup_bpf_detach()
746 struct bpf_prog_list *pl; in __cgroup_bpf_query() local
750 list_for_each_entry(pl, progs, node) { in __cgroup_bpf_query()
751 prog = prog_list_prog(pl); in __cgroup_bpf_query()