aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bpf-cgroup.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/bpf-cgroup.h')
-rw-r--r--include/linux/bpf-cgroup.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h
index e9871b012dac..7e0c9a1d48b7 100644
--- a/include/linux/bpf-cgroup.h
+++ b/include/linux/bpf-cgroup.h
@@ -23,7 +23,8 @@ struct bpf_cgroup_storage;
23extern struct static_key_false cgroup_bpf_enabled_key; 23extern struct static_key_false cgroup_bpf_enabled_key;
24#define cgroup_bpf_enabled static_branch_unlikely(&cgroup_bpf_enabled_key) 24#define cgroup_bpf_enabled static_branch_unlikely(&cgroup_bpf_enabled_key)
25 25
26DECLARE_PER_CPU(void*, bpf_cgroup_storage[MAX_BPF_CGROUP_STORAGE_TYPE]); 26DECLARE_PER_CPU(struct bpf_cgroup_storage*,
27 bpf_cgroup_storage[MAX_BPF_CGROUP_STORAGE_TYPE]);
27 28
28#define for_each_cgroup_storage_type(stype) \ 29#define for_each_cgroup_storage_type(stype) \
29 for (stype = 0; stype < MAX_BPF_CGROUP_STORAGE_TYPE; stype++) 30 for (stype = 0; stype < MAX_BPF_CGROUP_STORAGE_TYPE; stype++)
@@ -115,15 +116,9 @@ static inline void bpf_cgroup_storage_set(struct bpf_cgroup_storage
115 *storage[MAX_BPF_CGROUP_STORAGE_TYPE]) 116 *storage[MAX_BPF_CGROUP_STORAGE_TYPE])
116{ 117{
117 enum bpf_cgroup_storage_type stype; 118 enum bpf_cgroup_storage_type stype;
118 struct bpf_storage_buffer *buf;
119
120 for_each_cgroup_storage_type(stype) {
121 if (!storage[stype])
122 continue;
123 119
124 buf = READ_ONCE(storage[stype]->buf); 120 for_each_cgroup_storage_type(stype)
125 this_cpu_write(bpf_cgroup_storage[stype], &buf->data[0]); 121 this_cpu_write(bpf_cgroup_storage[stype], storage[stype]);
126 }
127} 122}
128 123
129struct bpf_cgroup_storage *bpf_cgroup_storage_alloc(struct bpf_prog *prog, 124struct bpf_cgroup_storage *bpf_cgroup_storage_alloc(struct bpf_prog *prog,