diff options
author | Roman Gushchin <guro@fb.com> | 2018-08-02 14:27:20 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-08-03 00:47:32 +0200 |
commit | d7bf2c10af053191e931b58704cd862fccb7f9de (patch) | |
tree | 825c4684143951754d5490aec16495733e0c6a48 /include/linux/bpf-cgroup.h | |
parent | aa0ad5b0391e268bdecf6cda31268388844f8afd (diff) | |
download | lwn-d7bf2c10af053191e931b58704cd862fccb7f9de.tar.gz lwn-d7bf2c10af053191e931b58704cd862fccb7f9de.zip |
bpf: allocate cgroup storage entries on attaching bpf programs
If a bpf program is using cgroup local storage, allocate
a bpf_cgroup_storage structure automatically on attaching the program
to a cgroup and save the pointer into the corresponding bpf_prog_list
entry.
Analogically, release the cgroup local storage on detaching
of the bpf program.
Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/linux/bpf-cgroup.h')
-rw-r--r-- | include/linux/bpf-cgroup.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h index 9a144ddbbc8f..f91b0f8ff3a9 100644 --- a/include/linux/bpf-cgroup.h +++ b/include/linux/bpf-cgroup.h @@ -43,6 +43,7 @@ struct bpf_cgroup_storage { struct bpf_prog_list { struct list_head node; struct bpf_prog *prog; + struct bpf_cgroup_storage *storage; }; struct bpf_prog_array; |