]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf: Lose const-ness of map in map_check_btf()
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Fri, 27 Feb 2026 22:48:02 +0000 (14:48 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 27 Feb 2026 23:39:00 +0000 (15:39 -0800)
commitae51772b1e94ba1d76db19085957dbccac189c1c
tree5b2c482e455a45652048cd5e95b712613a273e07
parent1df97a7453eec80c1912c2d0360290a3970a7671
bpf: Lose const-ness of map in map_check_btf()

BPF hash map may now use the map_check_btf() callback to decide whether
to set a dtor on its bpf_mem_alloc or not. Unlike C++ where members can
opt out of const-ness using mutable, we must lose the const qualifier on
the callback such that we can avoid the ugly cast. Make the change and
adjust all existing users, and lose the comment in hashtab.c.

Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20260227224806.646888-3-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
include/linux/bpf_local_storage.h
kernel/bpf/arena.c
kernel/bpf/arraymap.c
kernel/bpf/bloom_filter.c
kernel/bpf/bpf_insn_array.c
kernel/bpf/bpf_local_storage.c
kernel/bpf/hashtab.c
kernel/bpf/local_storage.c
kernel/bpf/lpm_trie.c
kernel/bpf/syscall.c