bpf: Make the bpf_prog_array_map more generic

All the map backends are of generic nature. In order to avoid
adding much special code into the eBPF core, rewrite part of
the bpf_prog_array map code and make it more generic. So the
new perf_event_array map type can reuse most of code with
bpf_prog_array map and add fewer lines of special code.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Signed-off-by: Kaixu Xia <xiakaixu@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Wang Nan
2015-08-06 07:02:33 +00:00
committed by David S. Miller
parent ffe8690c85
commit 2a36f0b92e
5 changed files with 60 additions and 38 deletions

View File

@@ -450,7 +450,7 @@ select_insn:
tail_call_cnt++;
prog = READ_ONCE(array->prog[index]);
prog = READ_ONCE(array->ptrs[index]);
if (unlikely(!prog))
goto out;