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()
380 if (preorder_cnt && (pl->flags & BPF_F_PREORDER)) in prog_list_length()
426 struct bpf_prog_list *pl; in compute_effective_progs() local
451 hlist_for_each_entry(pl, &p->bpf.progs[atype], node) { in compute_effective_progs()
452 if (!prog_list_prog(pl)) in compute_effective_progs()
455 if (pl->flags & BPF_F_PREORDER) { in compute_effective_progs()
462 item->prog = prog_list_prog(pl); in compute_effective_progs()
464 pl->storage); in compute_effective_progs()
595 struct bpf_prog_list *pl; in find_attach_entry() local
601 return hlist_entry(progs->first, typeof(*pl), node); in find_attach_entry()
604 hlist_for_each_entry(pl, progs, node) { in find_attach_entry()
605 if (prog && pl->prog == prog && prog != replace_prog) in find_attach_entry()
608 if (link && pl->link == link) in find_attach_entry()
615 hlist_for_each_entry(pl, progs, node) { in find_attach_entry()
616 if (pl->prog == replace_prog) in find_attach_entry()
618 return pl; in find_attach_entry()
651 struct bpf_prog_list *pl; in __cgroup_bpf_attach() local
685 pl = find_attach_entry(progs, prog, link, replace_prog, in __cgroup_bpf_attach()
687 if (IS_ERR(pl)) in __cgroup_bpf_attach()
688 return PTR_ERR(pl); in __cgroup_bpf_attach()
694 if (pl) { in __cgroup_bpf_attach()
695 old_prog = pl->prog; in __cgroup_bpf_attach()
699 pl = kmalloc(sizeof(*pl), GFP_KERNEL); in __cgroup_bpf_attach()
700 if (!pl) { in __cgroup_bpf_attach()
705 hlist_add_head(&pl->node, progs); in __cgroup_bpf_attach()
710 hlist_add_behind(&pl->node, last); in __cgroup_bpf_attach()
715 pl->prog = prog; in __cgroup_bpf_attach()
716 pl->link = link; in __cgroup_bpf_attach()
717 pl->flags = flags; in __cgroup_bpf_attach()
718 bpf_cgroup_storages_assign(pl->storage, storage); in __cgroup_bpf_attach()
747 pl->prog = old_prog; in __cgroup_bpf_attach()
748 pl->link = NULL; in __cgroup_bpf_attach()
752 hlist_del(&pl->node); in __cgroup_bpf_attach()
753 kfree(pl); in __cgroup_bpf_attach()
782 struct bpf_prog_list *pl; in replace_effective_prog() local
799 hlist_for_each_entry(pl, head, node) { in replace_effective_prog()
800 if (!prog_list_prog(pl)) in replace_effective_prog()
802 if (pl->link == link) in replace_effective_prog()
833 struct bpf_prog_list *pl; in __cgroup_bpf_replace() local
846 hlist_for_each_entry(pl, progs, node) { in __cgroup_bpf_replace()
847 if (pl->link == link) { in __cgroup_bpf_replace()
890 struct bpf_prog_list *pl; in find_detach_entry() local
900 return hlist_entry(progs->first, typeof(*pl), node); in find_detach_entry()
910 hlist_for_each_entry(pl, progs, node) { in find_detach_entry()
911 if (pl->prog == prog && pl->link == link) in find_detach_entry()
912 return pl; in find_detach_entry()
933 struct bpf_prog_list *pl; in purge_effective_progs() local
951 hlist_for_each_entry(pl, head, node) { in purge_effective_progs()
952 if (!prog_list_prog(pl)) in purge_effective_progs()
954 if (pl->prog == prog && pl->link == link) in purge_effective_progs()
989 struct bpf_prog_list *pl; in __cgroup_bpf_detach() local
1010 pl = find_detach_entry(progs, prog, link, flags & BPF_F_ALLOW_MULTI); in __cgroup_bpf_detach()
1011 if (IS_ERR(pl)) in __cgroup_bpf_detach()
1012 return PTR_ERR(pl); in __cgroup_bpf_detach()
1015 old_prog = pl->prog; in __cgroup_bpf_detach()
1016 pl->prog = NULL; in __cgroup_bpf_detach()
1017 pl->link = NULL; in __cgroup_bpf_detach()
1021 pl->prog = old_prog; in __cgroup_bpf_detach()
1022 pl->link = link; in __cgroup_bpf_detach()
1027 hlist_del(&pl->node); in __cgroup_bpf_detach()
1029 kfree(pl); in __cgroup_bpf_detach()
1120 struct bpf_prog_list *pl; in __cgroup_bpf_query() local
1127 hlist_for_each_entry(pl, progs, node) { in __cgroup_bpf_query()
1128 prog = prog_list_prog(pl); in __cgroup_bpf_query()