Lines Matching refs:map
31 struct bpf_map map; member
236 static int bpf_struct_ops_map_get_next_key(struct bpf_map *map, void *key, in bpf_struct_ops_map_get_next_key() argument
246 int bpf_struct_ops_map_sys_lookup_elem(struct bpf_map *map, void *key, in bpf_struct_ops_map_sys_lookup_elem() argument
249 struct bpf_struct_ops_map *st_map = (struct bpf_struct_ops_map *)map; in bpf_struct_ops_map_sys_lookup_elem()
260 memset(value, 0, map->value_size); in bpf_struct_ops_map_sys_lookup_elem()
268 memcpy(uvalue, st_map->uvalue, map->value_size); in bpf_struct_ops_map_sys_lookup_elem()
275 static void *bpf_struct_ops_map_lookup_elem(struct bpf_map *map, void *key) in bpf_struct_ops_map_lookup_elem() argument
352 static int bpf_struct_ops_map_update_elem(struct bpf_map *map, void *key, in bpf_struct_ops_map_update_elem() argument
355 struct bpf_struct_ops_map *st_map = (struct bpf_struct_ops_map *)map; in bpf_struct_ops_map_update_elem()
398 memcpy(uvalue, value, map->value_size); in bpf_struct_ops_map_update_elem()
495 bpf_map_inc(map); in bpf_struct_ops_map_update_elem()
516 bpf_map_put(map); in bpf_struct_ops_map_update_elem()
520 memset(uvalue, 0, map->value_size); in bpf_struct_ops_map_update_elem()
521 memset(kvalue, 0, map->value_size); in bpf_struct_ops_map_update_elem()
528 static int bpf_struct_ops_map_delete_elem(struct bpf_map *map, void *key) in bpf_struct_ops_map_delete_elem() argument
533 st_map = (struct bpf_struct_ops_map *)map; in bpf_struct_ops_map_delete_elem()
541 bpf_map_put(map); in bpf_struct_ops_map_delete_elem()
554 static void bpf_struct_ops_map_seq_show_elem(struct bpf_map *map, void *key, in bpf_struct_ops_map_seq_show_elem() argument
560 value = kmalloc(map->value_size, GFP_USER | __GFP_NOWARN); in bpf_struct_ops_map_seq_show_elem()
564 err = bpf_struct_ops_map_sys_lookup_elem(map, key, value); in bpf_struct_ops_map_seq_show_elem()
566 btf_type_seq_show(btf_vmlinux, map->btf_vmlinux_value_type_id, in bpf_struct_ops_map_seq_show_elem()
574 static void bpf_struct_ops_map_free(struct bpf_map *map) in bpf_struct_ops_map_free() argument
576 struct bpf_struct_ops_map *st_map = (struct bpf_struct_ops_map *)map; in bpf_struct_ops_map_free()
600 struct bpf_map *map; in bpf_struct_ops_map_alloc() local
626 map = &st_map->map; in bpf_struct_ops_map_alloc()
634 bpf_struct_ops_map_free(map); in bpf_struct_ops_map_alloc()
640 bpf_map_init_from_attr(map, attr); in bpf_struct_ops_map_alloc()
642 return map; in bpf_struct_ops_map_alloc()
675 bpf_map_put(&st_map->map); in bpf_struct_ops_put_rcu()