// SPDX-License-Identifier: GPL-2.0-only/* * Functions to manage eBPF programs attached to cgroups * * Copyright (c) 2016 Daniel Mack */#include<linux/kernel.h>#include<linux/atomic.h>#include<linux/cgroup.h>#include<linux/filter.h>#include<linux/slab.h>#include<linux/sysctl.h>#include<linux/string.h>#include<linux/bpf.h>#include<linux/bpf-cgroup.h>#include<net/sock.h>#include<net/bpf_sk_storage.h>#include"../cgroup/cgroup-internal.h"DEFINE_STATIC_KEY_FALSE(cgroup_bpf_enabled_key);EXPORT_SYMBOL(cgroup_bpf_enabled_key);voidcgroup_bpf_offline(structcgroup*cgrp){cgroup_get(cgrp);percpu_ref_kill(&cgrp->bpf.refcnt);}/** * cgroup_bpf_release() - put references of all bpf programs and * release all cgroup bpf data * @work: work structure embedded into the cgroup to modify */staticvoidcgroup_bpf_release(structwork_struct*work)