summaryrefslogtreecommitdiff
path: root/include/linux/bpf.h
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2016-06-15 22:47:12 +0200
committerMichael Bestas <mkbestas@lineageos.org>2022-04-19 00:50:20 +0300
commitbdcfb8d9a32910f4d027fbd516888f466befbf68 (patch)
tree19c4dad9c638e69d434634f072f8ec8f09f16cc2 /include/linux/bpf.h
parent58df94a330f5407c059dfe331beff61eb09f3eb6 (diff)
bpf, maps: add release callback
Add a release callback for maps that is invoked when the last reference to its struct file is gone and the struct file about to be released by vfs. The handler will be used by fd array maps. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Chatur27 <jasonbright2709@gmail.com>
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r--include/linux/bpf.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 0de4de6dd43e..5662f7052e75 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -18,7 +18,8 @@ struct bpf_map;
struct bpf_map_ops {
/* funcs callable from userspace (via syscall) */
struct bpf_map *(*map_alloc)(union bpf_attr *attr);
- void (*map_free)(struct bpf_map *);
+ void (*map_release)(struct bpf_map *map, struct file *map_file);
+ void (*map_free)(struct bpf_map *map);
int (*map_get_next_key)(struct bpf_map *map, void *key, void *next_key);
/* funcs callable from userspace and from eBPF programs */