summaryrefslogtreecommitdiff
path: root/include/linux/bpf_mem_alloc.h
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2026-03-01 20:03:45 +0300
committerAlexei Starovoitov <ast@kernel.org>2026-03-01 20:04:00 +0300
commit309d8808eef93d29b65ae69241a4475b2c8bd6fe (patch)
treec42851bcd612348cfeee1857c0b92a5cfc53bf50 /include/linux/bpf_mem_alloc.h
parentf620af11c27b8ec9994a39fe968aa778112d1566 (diff)
parenteb71ab2bf72260054677e348498ba995a057c463 (diff)
downloadlinux-309d8808eef93d29b65ae69241a4475b2c8bd6fe.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf before 7.0-rc2
Cross-merge BPF and other fixes after downstream PR. No conflicts. Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux/bpf_mem_alloc.h')
-rw-r--r--include/linux/bpf_mem_alloc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/bpf_mem_alloc.h b/include/linux/bpf_mem_alloc.h
index e45162ef59bb..4ce0d27f8ea2 100644
--- a/include/linux/bpf_mem_alloc.h
+++ b/include/linux/bpf_mem_alloc.h
@@ -14,6 +14,8 @@ struct bpf_mem_alloc {
struct obj_cgroup *objcg;
bool percpu;
struct work_struct work;
+ void (*dtor_ctx_free)(void *ctx);
+ void *dtor_ctx;
};
/* 'size != 0' is for bpf_mem_alloc which manages fixed-size objects.
@@ -32,6 +34,10 @@ int bpf_mem_alloc_percpu_init(struct bpf_mem_alloc *ma, struct obj_cgroup *objcg
/* The percpu allocation with a specific unit size. */
int bpf_mem_alloc_percpu_unit_init(struct bpf_mem_alloc *ma, int size);
void bpf_mem_alloc_destroy(struct bpf_mem_alloc *ma);
+void bpf_mem_alloc_set_dtor(struct bpf_mem_alloc *ma,
+ void (*dtor)(void *obj, void *ctx),
+ void (*dtor_ctx_free)(void *ctx),
+ void *ctx);
/* Check the allocation size for kmalloc equivalent allocator */
int bpf_mem_alloc_check_size(bool percpu, size_t size);