bpf: Add zero_map_value to zero map value with special fields
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Sun, 4 Sep 2022 20:41:16 +0000 (22:41 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 7 Sep 2022 18:46:34 +0000 (11:46 -0700)
commitcc48755808c646666436745b35629c3f0d05e165
tree6d751a095f90870c410008319bd51e5e33dc36a7
parent6df4ea1ff0ff70798ff1e7eed79f98ccb7b5b0a2
bpf: Add zero_map_value to zero map value with special fields

We need this helper to skip over special fields (bpf_spin_lock,
bpf_timer, kptrs) while zeroing a map value. Use the same logic as
copy_map_value but memset instead of memcpy.

Currently, the code zeroing map value memory does not have to deal with
special fields, hence this is a prerequisite for introducing such
support.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20220904204145.3089-4-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h