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

@@ -72,7 +72,7 @@ static int bpf_map_release(struct inode *inode, struct file *filp)
/* prog_array stores refcnt-ed bpf_prog pointers
* release them all when user space closes prog_array_fd
*/
bpf_prog_array_map_clear(map);
bpf_fd_array_map_clear(map);
bpf_map_put(map);
return 0;