diff options
author | Mickaël Salaün <mic@digikod.net> | 2018-01-26 00:54:02 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-01-25 18:05:24 -0800 |
commit | 9c147b56fc7165856da9c510463fafc2f0d58d5f (patch) | |
tree | 59c6854e9aa0c6a7a8f4098fe32a330e1be03c57 /kernel | |
parent | 82f1e0f3acf04dfd2de95f7ffb824528ecbf0a95 (diff) | |
download | linux-9c147b56fc7165856da9c510463fafc2f0d58d5f.tar.bz2 |
bpf: Use the IS_FD_ARRAY() macro in map_update_elem()
Make the code more readable.
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/bpf/syscall.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 5bdb0cc84ad2..e24aa3241387 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -709,10 +709,7 @@ static int map_update_elem(union bpf_attr *attr) err = bpf_percpu_hash_update(map, key, value, attr->flags); } else if (map->map_type == BPF_MAP_TYPE_PERCPU_ARRAY) { err = bpf_percpu_array_update(map, key, value, attr->flags); - } else if (map->map_type == BPF_MAP_TYPE_PERF_EVENT_ARRAY || - map->map_type == BPF_MAP_TYPE_PROG_ARRAY || - map->map_type == BPF_MAP_TYPE_CGROUP_ARRAY || - map->map_type == BPF_MAP_TYPE_ARRAY_OF_MAPS) { + } else if (IS_FD_ARRAY(map)) { rcu_read_lock(); err = bpf_fd_array_map_update_elem(map, f.file, key, value, attr->flags); |