summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAmery Hung <ameryhung@gmail.com>2025-11-14 12:13:25 -0800
committerAlexei Starovoitov <ast@kernel.org>2025-11-18 16:20:25 -0800
commit39a460c4253e4a437b6b372f462c0c043026784d (patch)
tree24ac06089892c697f4cbcdf82b72b0eac69942c0 /include/linux
parente76a33e1c7186526c2c133af73ea70da9275e1ba (diff)
bpf: Save memory alloction info in bpf_local_storage
Save the memory allocation method used for bpf_local_storage in the struct explicitly so that we don't need to go through the hassle to find out the info. When a later patch replaces BPF memory allocator with kmalloc_noloc(), bpf_local_storage_free() will no longer need smap->storage_ma to return the memory and completely remove the dependency on smap in bpf_local_storage_free(). 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-4-ameryhung@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/bpf_local_storage.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bpf_local_storage.h b/include/linux/bpf_local_storage.h
index 4ab137e75f33..7fef0cec8340 100644
--- a/include/linux/bpf_local_storage.h
+++ b/include/linux/bpf_local_storage.h
@@ -97,6 +97,7 @@ struct bpf_local_storage {
*/
struct rcu_head rcu;
raw_spinlock_t lock; /* Protect adding/removing from the "list" */
+ bool bpf_ma;
};
/* U16_MAX is much more than enough for sk local storage