Lines Matching full:storage
265 struct bpf_local_storage *prev_storage, *storage; in bpf_local_storage_alloc() local
269 err = mem_charge(smap, owner, sizeof(*storage)); in bpf_local_storage_alloc()
273 storage = bpf_map_kzalloc(&smap->map, sizeof(*storage), in bpf_local_storage_alloc()
275 if (!storage) { in bpf_local_storage_alloc()
280 INIT_HLIST_HEAD(&storage->list); in bpf_local_storage_alloc()
281 raw_spin_lock_init(&storage->lock); in bpf_local_storage_alloc()
282 storage->owner = owner; in bpf_local_storage_alloc()
284 bpf_selem_link_storage_nolock(storage, first_selem); in bpf_local_storage_alloc()
289 /* Publish storage to the owner. in bpf_local_storage_alloc()
294 * From now on, the owner->storage pointer (e.g. sk->sk_bpf_storage) in bpf_local_storage_alloc()
295 * is protected by the storage->lock. Hence, when freeing in bpf_local_storage_alloc()
296 * the owner->storage, the storage->lock must be held before in bpf_local_storage_alloc()
297 * setting owner->storage ptr to NULL. in bpf_local_storage_alloc()
299 prev_storage = cmpxchg(owner_storage_ptr, NULL, storage); in bpf_local_storage_alloc()
318 kfree(storage); in bpf_local_storage_alloc()
319 mem_uncharge(smap, owner, sizeof(*storage)); in bpf_local_storage_alloc()
493 * to the owner->storage or to the map bucket's list. in bpf_local_storage_map_free()
496 * or when the storage is freed e.g. in bpf_local_storage_map_free()
521 /* While freeing the storage we may still need to access the map. in bpf_local_storage_map_free()
527 * However, while freeing the storage one still needs to access the in bpf_local_storage_map_free()
531 * Hence, wait another rcu grace period for the storage to be freed. in bpf_local_storage_map_free()