Message ID | 20221023180519.2858371-1-yhs@fb.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | BPF |
Headers | show |
Series | bpf: Implement cgroup local storage available to non-cgroup-attached bpf progs | expand |
On Sun, Oct 23, 2022 at 11:05:19AM -0700, Yonghong Song wrote: > Make struct cgroup btf id global so later patch can reuse > the same btf id. > > Signed-off-by: Yonghong Song <yhs@fb.com> > --- > include/linux/btf_ids.h | 1 + > kernel/bpf/cgroup_iter.c | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h > index 2aea877d644f..c9744efd202f 100644 > --- a/include/linux/btf_ids.h > +++ b/include/linux/btf_ids.h > @@ -265,5 +265,6 @@ MAX_BTF_TRACING_TYPE, > }; > > extern u32 btf_tracing_ids[]; > +extern u32 bpf_cgroup_btf_id[]; > > #endif > diff --git a/kernel/bpf/cgroup_iter.c b/kernel/bpf/cgroup_iter.c > index 0d200a993489..c6ffc706d583 100644 > --- a/kernel/bpf/cgroup_iter.c > +++ b/kernel/bpf/cgroup_iter.c > @@ -157,7 +157,7 @@ static const struct seq_operations cgroup_iter_seq_ops = { > .show = cgroup_iter_seq_show, > }; > > -BTF_ID_LIST_SINGLE(bpf_cgroup_btf_id, struct, cgroup) > +BTF_ID_LIST_GLOBAL_SINGLE(bpf_cgroup_btf_id, struct, cgroup) > > static int cgroup_iter_seq_init(void *priv, struct bpf_iter_aux_info *aux) > { > -- > 2.30.2 > Acked-by: David Vernet <void@manifault.com>
diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h index 2aea877d644f..c9744efd202f 100644 --- a/include/linux/btf_ids.h +++ b/include/linux/btf_ids.h @@ -265,5 +265,6 @@ MAX_BTF_TRACING_TYPE, }; extern u32 btf_tracing_ids[]; +extern u32 bpf_cgroup_btf_id[]; #endif diff --git a/kernel/bpf/cgroup_iter.c b/kernel/bpf/cgroup_iter.c index 0d200a993489..c6ffc706d583 100644 --- a/kernel/bpf/cgroup_iter.c +++ b/kernel/bpf/cgroup_iter.c @@ -157,7 +157,7 @@ static const struct seq_operations cgroup_iter_seq_ops = { .show = cgroup_iter_seq_show, }; -BTF_ID_LIST_SINGLE(bpf_cgroup_btf_id, struct, cgroup) +BTF_ID_LIST_GLOBAL_SINGLE(bpf_cgroup_btf_id, struct, cgroup) static int cgroup_iter_seq_init(void *priv, struct bpf_iter_aux_info *aux) {
Make struct cgroup btf id global so later patch can reuse the same btf id. Signed-off-by: Yonghong Song <yhs@fb.com> --- include/linux/btf_ids.h | 1 + kernel/bpf/cgroup_iter.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)