Lines Matching full:storage
259 struct bpf_local_storage *prev_storage, *storage; in bpf_local_storage_alloc() local
263 err = mem_charge(smap, owner, sizeof(*storage)); in bpf_local_storage_alloc()
267 storage = kzalloc(sizeof(*storage), GFP_ATOMIC | __GFP_NOWARN); in bpf_local_storage_alloc()
268 if (!storage) { in bpf_local_storage_alloc()
273 INIT_HLIST_HEAD(&storage->list); in bpf_local_storage_alloc()
274 raw_spin_lock_init(&storage->lock); in bpf_local_storage_alloc()
275 storage->owner = owner; in bpf_local_storage_alloc()
277 bpf_selem_link_storage_nolock(storage, first_selem); in bpf_local_storage_alloc()
282 /* Publish storage to the owner. in bpf_local_storage_alloc()
287 * From now on, the owner->storage pointer (e.g. sk->sk_bpf_storage) in bpf_local_storage_alloc()
288 * is protected by the storage->lock. Hence, when freeing in bpf_local_storage_alloc()
289 * the owner->storage, the storage->lock must be held before in bpf_local_storage_alloc()
290 * setting owner->storage ptr to NULL. in bpf_local_storage_alloc()
292 prev_storage = cmpxchg(owner_storage_ptr, NULL, storage); in bpf_local_storage_alloc()
311 kfree(storage); in bpf_local_storage_alloc()
312 mem_uncharge(smap, owner, sizeof(*storage)); in bpf_local_storage_alloc()
484 * to the owner->storage or to the map bucket's list. in bpf_local_storage_map_free()
487 * or when the storage is freed e.g. in bpf_local_storage_map_free()
504 /* While freeing the storage we may still need to access the map. in bpf_local_storage_map_free()
510 * However, while freeing the storage one still needs to access the in bpf_local_storage_map_free()
514 * Hence, wait another rcu grace period for the storage to be freed. in bpf_local_storage_map_free()