]> Git Repo - linux.git/commit
bpf: make uniform use of array->elem_size everywhere in arraymap.c
authorAndrii Nakryiko <[email protected]>
Fri, 15 Jul 2022 05:31:44 +0000 (22:31 -0700)
committerAlexei Starovoitov <[email protected]>
Tue, 19 Jul 2022 16:45:34 +0000 (09:45 -0700)
commitd937bc3449fa868cbeaf5c87576f9929b765c1e0
tree8ff4872e0ead2666177b162d0320e2bf959f0e93
parent87ac0d600943994444e24382a87aa19acc4cd3d4
bpf: make uniform use of array->elem_size everywhere in arraymap.c

BPF_MAP_TYPE_ARRAY is rounding value_size to closest multiple of 8 and
stores that as array->elem_size for various memory allocations and
accesses.

But the code tends to re-calculate round_up(map->value_size, 8) in
multiple places instead of using array->elem_size. Cleaning this up and
making sure we always use array->size to avoid duplication of this
(admittedly simple) logic for consistency.

Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
kernel/bpf/arraymap.c
This page took 0.051606 seconds and 4 git commands to generate.