Lines Matching full:storage

286 		 * read if the freeing of the storage is done  in bpf_selem_unlink_storage_nolock()
290 * to the caller which then calls then frees the storage after in bpf_selem_unlink_storage_nolock()
453 struct bpf_local_storage *prev_storage, *storage; in bpf_local_storage_alloc() local
457 err = mem_charge(smap, owner, sizeof(*storage)); in bpf_local_storage_alloc()
463 storage = bpf_mem_cache_alloc_flags(&smap->storage_ma, gfp_flags); in bpf_local_storage_alloc()
466 storage = bpf_map_kzalloc(&smap->map, sizeof(*storage), in bpf_local_storage_alloc()
470 if (!storage) { in bpf_local_storage_alloc()
475 RCU_INIT_POINTER(storage->smap, smap); in bpf_local_storage_alloc()
476 INIT_HLIST_HEAD(&storage->list); in bpf_local_storage_alloc()
477 raw_spin_lock_init(&storage->lock); in bpf_local_storage_alloc()
478 storage->owner = owner; in bpf_local_storage_alloc()
480 bpf_selem_link_storage_nolock(storage, first_selem); in bpf_local_storage_alloc()
485 /* Publish storage to the owner. in bpf_local_storage_alloc()
490 * From now on, the owner->storage pointer (e.g. sk->sk_bpf_storage) in bpf_local_storage_alloc()
491 * is protected by the storage->lock. Hence, when freeing in bpf_local_storage_alloc()
492 * the owner->storage, the storage->lock must be held before in bpf_local_storage_alloc()
493 * setting owner->storage ptr to NULL. in bpf_local_storage_alloc()
495 prev_storage = cmpxchg(owner_storage_ptr, NULL, storage); in bpf_local_storage_alloc()
515 bpf_local_storage_free(storage, smap, smap->bpf_ma, true); in bpf_local_storage_alloc()
516 mem_uncharge(smap, owner, sizeof(*storage)); in bpf_local_storage_alloc()
733 * intends to remove all local storage. So the last iteration in bpf_local_storage_destroy()
756 * A deadlock free allocator is useful for storage that the bpf prog can easily
758 * The task and cgroup storage fall into this case. The bpf_mem_alloc reuses
843 * to the owner->storage or to the map bucket's list. in bpf_local_storage_map_free()
846 * or when the storage is freed e.g. in bpf_local_storage_map_free()
871 /* While freeing the storage we may still need to access the map. in bpf_local_storage_map_free()
877 * However, while freeing the storage one still needs to access the in bpf_local_storage_map_free()
881 * Hence, wait another rcu grace period for the storage to be freed. in bpf_local_storage_map_free()