Lines Matching full:pl

318 		struct bpf_prog_list *pl;
321 hlist_for_each_entry_safe(pl, pltmp, progs, node) {
322 hlist_del(&pl->node);
323 if (pl->prog) {
324 if (pl->prog->expected_attach_type == BPF_LSM_CGROUP)
325 bpf_trampoline_unlink_cgroup_shim(pl->prog);
326 bpf_prog_put(pl->prog);
328 if (pl->link) {
329 if (pl->link->link.prog->expected_attach_type == BPF_LSM_CGROUP)
330 bpf_trampoline_unlink_cgroup_shim(pl->link->link.prog);
331 bpf_cgroup_link_auto_detach(pl->link);
333 kfree(pl);
372 static struct bpf_prog *prog_list_prog(struct bpf_prog_list *pl)
374 if (pl->prog)
375 return pl->prog;
376 if (pl->link)
377 return pl->link->link.prog;
386 struct bpf_prog_list *pl;
389 hlist_for_each_entry(pl, head, node) {
390 if (!prog_list_prog(pl))
392 if (preorder_cnt && (pl->flags & BPF_F_PREORDER))
438 struct bpf_prog_list *pl;
463 hlist_for_each_entry(pl, &p->bpf.progs[atype], node) {
464 if (!prog_list_prog(pl))
467 if (pl->flags & BPF_F_PREORDER) {
474 item->prog = prog_list_prog(pl);
476 pl->storage);
628 struct bpf_prog_list *pl;
634 return hlist_entry(progs->first, typeof(*pl), node);
637 hlist_for_each_entry(pl, progs, node) {
638 if (prog && pl->prog == prog && prog != replace_prog)
641 if (link && pl->link == link)
648 hlist_for_each_entry(pl, progs, node) {
649 if (pl->prog == replace_prog)
651 return pl;
686 struct bpf_prog_list *pltmp, *pl = ERR_PTR(-EINVAL);
736 pl = pltmp;
741 pl = ERR_PTR(-ENOENT);
747 return pl;
750 static int insert_pl_to_hlist(struct bpf_prog_list *pl, struct hlist_head *progs,
761 hlist_add_head(&pl->node, progs);
763 hlist_add_before(&pl->node, &pltmp->node);
765 hlist_add_behind(&pl->node, &pltmp->node);
797 struct bpf_prog_list *pl;
836 pl = find_attach_entry(progs, prog, link, replace_prog,
838 if (IS_ERR(pl))
839 return PTR_ERR(pl);
845 if (pl) {
846 old_prog = pl->prog;
848 pl = kmalloc(sizeof(*pl), GFP_KERNEL);
849 if (!pl) {
854 err = insert_pl_to_hlist(pl, progs, prog, link, flags, id_or_fd);
856 kfree(pl);
862 pl->prog = prog;
863 pl->link = link;
864 pl->flags = flags;
865 bpf_cgroup_storages_assign(pl->storage, storage);
895 pl->prog = old_prog;
896 pl->link = NULL;
900 hlist_del(&pl->node);
901 kfree(pl);
931 struct bpf_prog_list *pl;
948 hlist_for_each_entry(pl, head, node) {
949 if (!prog_list_prog(pl))
951 if (pl->link == link)
982 struct bpf_prog_list *pl;
995 hlist_for_each_entry(pl, progs, node) {
996 if (pl->link == link) {
1040 struct bpf_prog_list *pl;
1050 return hlist_entry(progs->first, typeof(*pl), node);
1060 hlist_for_each_entry(pl, progs, node) {
1061 if (pl->prog == prog && pl->link == link)
1062 return pl;
1083 struct bpf_prog_list *pl;
1101 hlist_for_each_entry(pl, head, node) {
1102 if (!prog_list_prog(pl))
1104 if (pl->prog == prog && pl->link == link)
1141 struct bpf_prog_list *pl;
1165 pl = find_detach_entry(progs, prog, link, flags & BPF_F_ALLOW_MULTI);
1166 if (IS_ERR(pl))
1167 return PTR_ERR(pl);
1170 old_prog = pl->prog;
1171 pl->prog = NULL;
1172 pl->link = NULL;
1176 pl->prog = old_prog;
1177 pl->link = link;
1182 hlist_del(&pl->node);
1185 kfree(pl);
1281 struct bpf_prog_list *pl;
1288 hlist_for_each_entry(pl, progs, node) {
1289 prog = prog_list_prog(pl);