add bpf_for_each_map_elem() helper definition
See 5.12+ kernel's include/uapi/linux/bpf.h (note that since bpf is 64-bit, int and long are the same thing) Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: Ib340a619645ad5ab8e41ff76cb7b51671f496bc5
This commit is contained in:
parent
e766a09b79
commit
c5dcf2c8ea
1 changed files with 4 additions and 0 deletions
|
|
@ -138,6 +138,10 @@ static int (*bpf_map_update_elem_unsafe)(const struct bpf_map_def* map, const vo
|
|||
static int (*bpf_map_delete_elem_unsafe)(const struct bpf_map_def* map,
|
||||
const void* key) = (void*)BPF_FUNC_map_delete_elem;
|
||||
|
||||
static int (*bpf_for_each_map_elem)(const struct bpf_map_def* map, void *callback_fn,
|
||||
void *callback_ctx, unsigned long long flags) = (void*)
|
||||
BPF_FUNC_for_each_map_elem;
|
||||
|
||||
#define BPF_ANNOTATE_KV_PAIR(name, type_key, type_val) \
|
||||
struct ____btf_map_##name { \
|
||||
type_key key; \
|
||||
|
|
|
|||
Loading…
Reference in a new issue