Lines Matching defs:storage

286 		 * read if the freeing of the storage is done
290 * to the caller which then calls then frees the storage after
453 struct bpf_local_storage *prev_storage, *storage;
457 err = mem_charge(smap, owner, sizeof(*storage));
463 storage = bpf_mem_cache_alloc_flags(&smap->storage_ma, gfp_flags);
466 storage = bpf_map_kzalloc(&smap->map, sizeof(*storage),
470 if (!storage) {
475 RCU_INIT_POINTER(storage->smap, smap);
476 INIT_HLIST_HEAD(&storage->list);
477 raw_spin_lock_init(&storage->lock);
478 storage->owner = owner;
480 bpf_selem_link_storage_nolock(storage, first_selem);
485 /* Publish storage to the owner.
490 * From now on, the owner->storage pointer (e.g. sk->sk_bpf_storage)
491 * is protected by the storage->lock. Hence, when freeing
492 * the owner->storage, the storage->lock must be held before
493 * setting owner->storage ptr to NULL.
495 prev_storage = cmpxchg(owner_storage_ptr, NULL, storage);
515 bpf_local_storage_free(storage, smap, smap->bpf_ma, true);
516 mem_uncharge(smap, owner, sizeof(*storage));
733 * intends to remove all local storage. So the last iteration
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.
846 * or when the storage is freed e.g.
871 /* While freeing the storage we may still need to access the map.
877 * However, while freeing the storage one still needs to access the
881 * Hence, wait another rcu grace period for the storage to be freed.