summaryrefslogtreecommitdiff
path: root/include/linux/bpf_mem_alloc.h
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2026-03-22 15:20:42 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2026-03-22 15:20:42 +0300
commit9e4e86a604dfd06402933467578c4b79f5412b2c (patch)
tree5cf2d962b699987c8a785e35a5f5c5f450532c0a /include/linux/bpf_mem_alloc.h
parente8b83499b4cbc8b989f7cd6aaa893b669326e93c (diff)
parentf338e77383789c0cae23ca3d48adcc5e9e137e3c (diff)
downloadlinux-9e4e86a604dfd06402933467578c4b79f5412b2c.tar.xz
Merge tag 'v7.0-rc4' into togreg
Linux 7.0-rc4 Required for the ds4422 series which is build upon; 5187e03b817c ("iio: dac: ds4424: reject -128 RAW value")
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);