diff options
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r-- | include/linux/bpf.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 3cf91754a957..bbfceb756452 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h | |||
@@ -22,7 +22,7 @@ struct bpf_map_ops { | |||
22 | 22 | ||
23 | /* funcs callable from userspace and from eBPF programs */ | 23 | /* funcs callable from userspace and from eBPF programs */ |
24 | void *(*map_lookup_elem)(struct bpf_map *map, void *key); | 24 | void *(*map_lookup_elem)(struct bpf_map *map, void *key); |
25 | int (*map_update_elem)(struct bpf_map *map, void *key, void *value); | 25 | int (*map_update_elem)(struct bpf_map *map, void *key, void *value, u64 flags); |
26 | int (*map_delete_elem)(struct bpf_map *map, void *key); | 26 | int (*map_delete_elem)(struct bpf_map *map, void *key); |
27 | }; | 27 | }; |
28 | 28 | ||
@@ -128,9 +128,18 @@ struct bpf_prog_aux { | |||
128 | struct work_struct work; | 128 | struct work_struct work; |
129 | }; | 129 | }; |
130 | 130 | ||
131 | #ifdef CONFIG_BPF_SYSCALL | ||
131 | void bpf_prog_put(struct bpf_prog *prog); | 132 | void bpf_prog_put(struct bpf_prog *prog); |
133 | #else | ||
134 | static inline void bpf_prog_put(struct bpf_prog *prog) {} | ||
135 | #endif | ||
132 | struct bpf_prog *bpf_prog_get(u32 ufd); | 136 | struct bpf_prog *bpf_prog_get(u32 ufd); |
133 | /* verify correctness of eBPF program */ | 137 | /* verify correctness of eBPF program */ |
134 | int bpf_check(struct bpf_prog *fp, union bpf_attr *attr); | 138 | int bpf_check(struct bpf_prog *fp, union bpf_attr *attr); |
135 | 139 | ||
140 | /* verifier prototypes for helper functions called from eBPF programs */ | ||
141 | extern struct bpf_func_proto bpf_map_lookup_elem_proto; | ||
142 | extern struct bpf_func_proto bpf_map_update_elem_proto; | ||
143 | extern struct bpf_func_proto bpf_map_delete_elem_proto; | ||
144 | |||
136 | #endif /* _LINUX_BPF_H */ | 145 | #endif /* _LINUX_BPF_H */ |