bpf: Use bpf_create_map() from the library

Replace bpf_map_create() with bpf_create_map() calls.

Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Mickaël Salaün
2017-02-10 00:21:43 +01:00
committed by David S. Miller
parent 5f155c2563
commit f4874d01be
6 changed files with 15 additions and 30 deletions

View File

@@ -4467,7 +4467,7 @@ static int create_map(uint32_t size_value, uint32_t max_elem)
{
int fd;
fd = bpf_map_create(BPF_MAP_TYPE_HASH, sizeof(long long),
fd = bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(long long),
size_value, max_elem, BPF_F_NO_PREALLOC);
if (fd < 0)
printf("Failed to create hash map '%s'!\n", strerror(errno));
@@ -4479,7 +4479,7 @@ static int create_prog_array(void)
{
int fd;
fd = bpf_map_create(BPF_MAP_TYPE_PROG_ARRAY, sizeof(int),
fd = bpf_create_map(BPF_MAP_TYPE_PROG_ARRAY, sizeof(int),
sizeof(int), 4, 0);
if (fd < 0)
printf("Failed to create prog array '%s'!\n", strerror(errno));