Lines Matching refs:pl
289 struct bpf_prog_list *pl; in cgroup_bpf_release() local
292 hlist_for_each_entry_safe(pl, pltmp, progs, node) { in cgroup_bpf_release()
293 hlist_del(&pl->node); in cgroup_bpf_release()
294 if (pl->prog) { in cgroup_bpf_release()
295 if (pl->prog->expected_attach_type == BPF_LSM_CGROUP) in cgroup_bpf_release()
296 bpf_trampoline_unlink_cgroup_shim(pl->prog); in cgroup_bpf_release()
297 bpf_prog_put(pl->prog); in cgroup_bpf_release()
299 if (pl->link) { in cgroup_bpf_release()
300 if (pl->link->link.prog->expected_attach_type == BPF_LSM_CGROUP) in cgroup_bpf_release()
301 bpf_trampoline_unlink_cgroup_shim(pl->link->link.prog); in cgroup_bpf_release()
302 bpf_cgroup_link_auto_detach(pl->link); in cgroup_bpf_release()
304 kfree(pl); in cgroup_bpf_release()
343 static struct bpf_prog *prog_list_prog(struct bpf_prog_list *pl) in prog_list_prog() argument
345 if (pl->prog) in prog_list_prog()
346 return pl->prog; in prog_list_prog()
347 if (pl->link) in prog_list_prog()
348 return pl->link->link.prog; in prog_list_prog()
357 struct bpf_prog_list *pl; in prog_list_length() local
360 hlist_for_each_entry(pl, head, node) { in prog_list_length()
361 if (!prog_list_prog(pl)) in prog_list_length()
407 struct bpf_prog_list *pl; in compute_effective_progs() local
429 hlist_for_each_entry(pl, &p->bpf.progs[atype], node) { in compute_effective_progs()
430 if (!prog_list_prog(pl)) in compute_effective_progs()
434 item->prog = prog_list_prog(pl); in compute_effective_progs()
436 pl->storage); in compute_effective_progs()
562 struct bpf_prog_list *pl; in find_attach_entry() local
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()
572 if (prog && pl->prog == prog && prog != replace_prog) in find_attach_entry()
575 if (link && pl->link == link) in find_attach_entry()
582 hlist_for_each_entry(pl, progs, node) { in find_attach_entry()
583 if (pl->prog == replace_prog) in find_attach_entry()
585 return pl; in find_attach_entry()
618 struct bpf_prog_list *pl; in __cgroup_bpf_attach() local
652 pl = find_attach_entry(progs, prog, link, replace_prog, in __cgroup_bpf_attach()
654 if (IS_ERR(pl)) in __cgroup_bpf_attach()
655 return PTR_ERR(pl); in __cgroup_bpf_attach()
661 if (pl) { in __cgroup_bpf_attach()
662 old_prog = pl->prog; in __cgroup_bpf_attach()
666 pl = kmalloc(sizeof(*pl), GFP_KERNEL); in __cgroup_bpf_attach()
667 if (!pl) { in __cgroup_bpf_attach()
672 hlist_add_head(&pl->node, progs); in __cgroup_bpf_attach()
677 hlist_add_behind(&pl->node, last); in __cgroup_bpf_attach()
682 pl->prog = prog; in __cgroup_bpf_attach()
683 pl->link = link; in __cgroup_bpf_attach()
684 bpf_cgroup_storages_assign(pl->storage, storage); in __cgroup_bpf_attach()
713 pl->prog = old_prog; in __cgroup_bpf_attach()
714 pl->link = NULL; in __cgroup_bpf_attach()
718 hlist_del(&pl->node); in __cgroup_bpf_attach()
719 kfree(pl); in __cgroup_bpf_attach()
748 struct bpf_prog_list *pl; in replace_effective_prog() local
765 hlist_for_each_entry(pl, head, node) { in replace_effective_prog()
766 if (!prog_list_prog(pl)) in replace_effective_prog()
768 if (pl->link == link) in replace_effective_prog()
798 struct bpf_prog_list *pl; in __cgroup_bpf_replace() local
811 hlist_for_each_entry(pl, progs, node) { in __cgroup_bpf_replace()
812 if (pl->link == link) { in __cgroup_bpf_replace()
855 struct bpf_prog_list *pl; in find_detach_entry() local
865 return hlist_entry(progs->first, typeof(*pl), node); in find_detach_entry()
875 hlist_for_each_entry(pl, progs, node) { in find_detach_entry()
876 if (pl->prog == prog && pl->link == link) in find_detach_entry()
877 return pl; in find_detach_entry()
898 struct bpf_prog_list *pl; in purge_effective_progs() local
916 hlist_for_each_entry(pl, head, node) { in purge_effective_progs()
917 if (!prog_list_prog(pl)) in purge_effective_progs()
919 if (pl->prog == prog && pl->link == link) in purge_effective_progs()
954 struct bpf_prog_list *pl; in __cgroup_bpf_detach() local
975 pl = find_detach_entry(progs, prog, link, flags & BPF_F_ALLOW_MULTI); in __cgroup_bpf_detach()
976 if (IS_ERR(pl)) in __cgroup_bpf_detach()
977 return PTR_ERR(pl); in __cgroup_bpf_detach()
980 old_prog = pl->prog; in __cgroup_bpf_detach()
981 pl->prog = NULL; in __cgroup_bpf_detach()
982 pl->link = NULL; in __cgroup_bpf_detach()
986 pl->prog = old_prog; in __cgroup_bpf_detach()
987 pl->link = link; in __cgroup_bpf_detach()
992 hlist_del(&pl->node); in __cgroup_bpf_detach()
994 kfree(pl); in __cgroup_bpf_detach()
1085 struct bpf_prog_list *pl; in __cgroup_bpf_query() local
1092 hlist_for_each_entry(pl, progs, node) { in __cgroup_bpf_query()
1093 prog = prog_list_prog(pl); in __cgroup_bpf_query()