]> Gentwo Git Trees - linux/.git/commit
bpf: Remove smap argument from bpf_selem_free()
authorAmery Hung <ameryhung@gmail.com>
Fri, 14 Nov 2025 20:13:24 +0000 (12:13 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 19 Nov 2025 00:20:25 +0000 (16:20 -0800)
commite76a33e1c7186526c2c133af73ea70da9275e1ba
treec316148251a99a01d98c89fbd83bdd4d322a59c7
parent0e854e55356908386605714e66f98c3985d9e266
bpf: Remove smap argument from bpf_selem_free()

Since selem already saves a pointer to smap, use it instead of an
additional argument in bpf_selem_free(). This requires moving the
SDATA(selem)->smap assignment from bpf_selem_link_map() to
bpf_selem_alloc() since bpf_selem_free() may be called without the
selem being linked to smap in bpf_local_storage_update().

Signed-off-by: Amery Hung <ameryhung@gmail.com>
Reviewed-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20251114201329.3275875-3-ameryhung@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf_local_storage.h
kernel/bpf/bpf_local_storage.c
net/core/bpf_sk_storage.c