Lines Matching full:pl

306 		struct bpf_prog_list *pl;  in cgroup_bpf_release()  local
309 hlist_for_each_entry_safe(pl, pltmp, progs, node) { in cgroup_bpf_release()
310 hlist_del(&pl->node); in cgroup_bpf_release()
311 if (pl->prog) { in cgroup_bpf_release()
312 if (pl->prog->expected_attach_type == BPF_LSM_CGROUP) in cgroup_bpf_release()
313 bpf_trampoline_unlink_cgroup_shim(pl->prog); in cgroup_bpf_release()
314 bpf_prog_put(pl->prog); in cgroup_bpf_release()
316 if (pl->link) { in cgroup_bpf_release()
317 if (pl->link->link.prog->expected_attach_type == BPF_LSM_CGROUP) in cgroup_bpf_release()
318 bpf_trampoline_unlink_cgroup_shim(pl->link->link.prog); in cgroup_bpf_release()
319 bpf_cgroup_link_auto_detach(pl->link); in cgroup_bpf_release()
321 kfree(pl); in cgroup_bpf_release()
360 static struct bpf_prog *prog_list_prog(struct bpf_prog_list *pl) in prog_list_prog() argument
362 if (pl->prog) in prog_list_prog()
363 return pl->prog; in prog_list_prog()
364 if (pl->link) in prog_list_prog()
365 return pl->link->link.prog; in prog_list_prog()
374 struct bpf_prog_list *pl; in prog_list_length() local
377 hlist_for_each_entry(pl, head, node) { in prog_list_length()
378 if (!prog_list_prog(pl)) in prog_list_length()
424 struct bpf_prog_list *pl; in compute_effective_progs() local
446 hlist_for_each_entry(pl, &p->bpf.progs[atype], node) { in compute_effective_progs()
447 if (!prog_list_prog(pl)) in compute_effective_progs()
451 item->prog = prog_list_prog(pl); in compute_effective_progs()
453 pl->storage); in compute_effective_progs()
579 struct bpf_prog_list *pl; in find_attach_entry() local
585 return hlist_entry(progs->first, typeof(*pl), node); in find_attach_entry()
588 hlist_for_each_entry(pl, progs, node) { in find_attach_entry()
589 if (prog && pl->prog == prog && prog != replace_prog) in find_attach_entry()
592 if (link && pl->link == link) in find_attach_entry()
599 hlist_for_each_entry(pl, progs, node) { in find_attach_entry()
600 if (pl->prog == replace_prog) in find_attach_entry()
602 return pl; in find_attach_entry()
635 struct bpf_prog_list *pl; in __cgroup_bpf_attach() local
669 pl = find_attach_entry(progs, prog, link, replace_prog, in __cgroup_bpf_attach()
671 if (IS_ERR(pl)) in __cgroup_bpf_attach()
672 return PTR_ERR(pl); in __cgroup_bpf_attach()
678 if (pl) { in __cgroup_bpf_attach()
679 old_prog = pl->prog; in __cgroup_bpf_attach()
683 pl = kmalloc(sizeof(*pl), GFP_KERNEL); in __cgroup_bpf_attach()
684 if (!pl) { in __cgroup_bpf_attach()
689 hlist_add_head(&pl->node, progs); in __cgroup_bpf_attach()
694 hlist_add_behind(&pl->node, last); in __cgroup_bpf_attach()
699 pl->prog = prog; in __cgroup_bpf_attach()
700 pl->link = link; in __cgroup_bpf_attach()
701 bpf_cgroup_storages_assign(pl->storage, storage); in __cgroup_bpf_attach()
730 pl->prog = old_prog; in __cgroup_bpf_attach()
731 pl->link = NULL; in __cgroup_bpf_attach()
735 hlist_del(&pl->node); in __cgroup_bpf_attach()
736 kfree(pl); in __cgroup_bpf_attach()
765 struct bpf_prog_list *pl; in replace_effective_prog() local
782 hlist_for_each_entry(pl, head, node) { in replace_effective_prog()
783 if (!prog_list_prog(pl)) in replace_effective_prog()
785 if (pl->link == link) in replace_effective_prog()
816 struct bpf_prog_list *pl; in __cgroup_bpf_replace() local
829 hlist_for_each_entry(pl, progs, node) { in __cgroup_bpf_replace()
830 if (pl->link == link) { in __cgroup_bpf_replace()
873 struct bpf_prog_list *pl; in find_detach_entry() local
883 return hlist_entry(progs->first, typeof(*pl), node); in find_detach_entry()
893 hlist_for_each_entry(pl, progs, node) { in find_detach_entry()
894 if (pl->prog == prog && pl->link == link) in find_detach_entry()
895 return pl; in find_detach_entry()
916 struct bpf_prog_list *pl; in purge_effective_progs() local
934 hlist_for_each_entry(pl, head, node) { in purge_effective_progs()
935 if (!prog_list_prog(pl)) in purge_effective_progs()
937 if (pl->prog == prog && pl->link == link) in purge_effective_progs()
972 struct bpf_prog_list *pl; in __cgroup_bpf_detach() local
993 pl = find_detach_entry(progs, prog, link, flags & BPF_F_ALLOW_MULTI); in __cgroup_bpf_detach()
994 if (IS_ERR(pl)) in __cgroup_bpf_detach()
995 return PTR_ERR(pl); in __cgroup_bpf_detach()
998 old_prog = pl->prog; in __cgroup_bpf_detach()
999 pl->prog = NULL; in __cgroup_bpf_detach()
1000 pl->link = NULL; in __cgroup_bpf_detach()
1004 pl->prog = old_prog; in __cgroup_bpf_detach()
1005 pl->link = link; in __cgroup_bpf_detach()
1010 hlist_del(&pl->node); in __cgroup_bpf_detach()
1012 kfree(pl); in __cgroup_bpf_detach()
1103 struct bpf_prog_list *pl; in __cgroup_bpf_query() local
1110 hlist_for_each_entry(pl, progs, node) { in __cgroup_bpf_query()
1111 prog = prog_list_prog(pl); in __cgroup_bpf_query()