diff options
author | Roman Gushchin <guro@fb.com> | 2018-08-02 14:27:21 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-08-03 00:47:32 +0200 |
commit | 394e40a29788820c9c0526b1c3497c9e0ec2a126 (patch) | |
tree | f82d888493270cd2df836923c98f5c12fe8d7bab /drivers/media/rc | |
parent | d7bf2c10af053191e931b58704cd862fccb7f9de (diff) | |
download | linux-394e40a29788820c9c0526b1c3497c9e0ec2a126.tar.gz linux-394e40a29788820c9c0526b1c3497c9e0ec2a126.tar.bz2 linux-394e40a29788820c9c0526b1c3497c9e0ec2a126.zip |
bpf: extend bpf_prog_array to store pointers to the cgroup storage
This patch converts bpf_prog_array from an array of prog pointers
to the array of struct bpf_prog_array_item elements.
This allows to save a cgroup storage pointer for each bpf program
efficiently attached to a cgroup.
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 'drivers/media/rc')
-rw-r--r-- | drivers/media/rc/bpf-lirc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/rc/bpf-lirc.c b/drivers/media/rc/bpf-lirc.c index fcfab6635f9c..8c26df9b96c1 100644 --- a/drivers/media/rc/bpf-lirc.c +++ b/drivers/media/rc/bpf-lirc.c @@ -195,14 +195,16 @@ void lirc_bpf_run(struct rc_dev *rcdev, u32 sample) */ void lirc_bpf_free(struct rc_dev *rcdev) { - struct bpf_prog **progs; + struct bpf_prog_array_item *item; if (!rcdev->raw->progs) return; - progs = rcu_dereference(rcdev->raw->progs)->progs; - while (*progs) - bpf_prog_put(*progs++); + item = rcu_dereference(rcdev->raw->progs)->items; + while (item->prog) { + bpf_prog_put(item->prog); + item++; + } bpf_prog_array_free(rcdev->raw->progs); } |