Ejemplo n.º 1
0
/* decrement refcnt of all bpf_progs that are stored in this map */
void bpf_fd_array_map_clear(struct bpf_map *map)
{
    struct bpf_array *array = container_of(map, struct bpf_array, map);
    int i;

    for (i = 0; i < array->map.max_entries; i++)
        fd_array_map_delete_elem(map, &i);
}
Ejemplo n.º 2
0
static void perf_event_fd_array_release(struct bpf_map *map,
                                        struct file *map_file)
{
    struct bpf_array *array = container_of(map, struct bpf_array, map);
    struct bpf_event_entry *ee;
    int i;

    rcu_read_lock();
    for (i = 0; i < array->map.max_entries; i++) {
        ee = READ_ONCE(array->ptrs[i]);
        if (ee && ee->map_file == map_file)
            fd_array_map_delete_elem(map, &i);
    }
    rcu_read_unlock();
}