enum bpf_cgroup_storage_type is needed both in bpf.h and bpf-cgroup.h. Since we want to break the cgroup -> bpf dependency we need to place it in its own header. Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> --- include/linux/bpf-cgroup-types.h | 13 +++++++++++++ include/linux/bpf.h | 9 +-------- 2 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 include/linux/bpf-cgroup-types.h diff --git a/include/linux/bpf-cgroup-types.h b/include/linux/bpf-cgroup-types.h new file mode 100644 index 000000000000..343dd5c2128d --- /dev/null +++ b/include/linux/bpf-cgroup-types.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _BPF_CGROUP_TYPES_H +#define _BPF_CGROUP_TYPES_H + +enum bpf_cgroup_storage_type { + BPF_CGROUP_STORAGE_SHARED, + BPF_CGROUP_STORAGE_PERCPU, + __BPF_CGROUP_STORAGE_MAX +}; + +#define MAX_BPF_CGROUP_STORAGE_TYPE __BPF_CGROUP_STORAGE_MAX + +#endif diff --git a/include/linux/bpf.h b/include/linux/bpf.h index cc7a0c36e7df..47f0a3cfec24 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -22,6 +22,7 @@ #include <linux/sched/mm.h> #include <linux/slab.h> #include <linux/percpu-refcount.h> +#include <linux/bpf-cgroup-types.h> #include <linux/bpfptr.h> struct bpf_verifier_env; @@ -550,14 +551,6 @@ struct bpf_prog_offload { u32 jited_len; }; -enum bpf_cgroup_storage_type { - BPF_CGROUP_STORAGE_SHARED, - BPF_CGROUP_STORAGE_PERCPU, - __BPF_CGROUP_STORAGE_MAX -}; - -#define MAX_BPF_CGROUP_STORAGE_TYPE __BPF_CGROUP_STORAGE_MAX - /* The longest tracepoint has 12 args. * See include/trace/bpf_probe.h */ -- 2.31.1