summaryrefslogtreecommitdiff
path: root/include/linux/bpf.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r--include/linux/bpf.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 3a38db315f7f..756b85f0d0d3 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -189,10 +189,19 @@ enum btf_field_type {
BPF_RB_NODE | BPF_RB_ROOT,
};
+typedef void (*btf_dtor_kfunc_t)(void *);
+typedef void (*btf_dtor_obj_drop)(void *, const struct btf_record *);
+
struct btf_field_kptr {
struct btf *btf;
struct module *module;
- btf_dtor_kfunc_t dtor;
+ union {
+ /* dtor used if btf_is_kernel(btf), otherwise the type
+ * is program-allocated and obj_drop is used
+ */
+ btf_dtor_kfunc_t dtor;
+ btf_dtor_obj_drop obj_drop;
+ };
u32 btf_id;
};