Lines Matching refs:cache

295 	if (rcu_access_pointer(local_storage->cache[smap->cache_idx]) ==  in bpf_selem_unlink_storage_nolock()
297 RCU_INIT_POINTER(local_storage->cache[smap->cache_idx], NULL); in bpf_selem_unlink_storage_nolock()
427 sdata = rcu_dereference_check(local_storage->cache[smap->cache_idx], in bpf_local_storage_lookup()
452 rcu_assign_pointer(local_storage->cache[smap->cache_idx], in bpf_local_storage_lookup()
665 static u16 bpf_local_storage_cache_idx_get(struct bpf_local_storage_cache *cache) in bpf_local_storage_cache_idx_get() argument
670 spin_lock(&cache->idx_lock); in bpf_local_storage_cache_idx_get()
673 if (cache->idx_usage_counts[i] < min_usage) { in bpf_local_storage_cache_idx_get()
674 min_usage = cache->idx_usage_counts[i]; in bpf_local_storage_cache_idx_get()
682 cache->idx_usage_counts[res]++; in bpf_local_storage_cache_idx_get()
684 spin_unlock(&cache->idx_lock); in bpf_local_storage_cache_idx_get()
689 static void bpf_local_storage_cache_idx_free(struct bpf_local_storage_cache *cache, in bpf_local_storage_cache_idx_free() argument
692 spin_lock(&cache->idx_lock); in bpf_local_storage_cache_idx_free()
693 cache->idx_usage_counts[idx]--; in bpf_local_storage_cache_idx_free()
694 spin_unlock(&cache->idx_lock); in bpf_local_storage_cache_idx_free()
793 struct bpf_local_storage_cache *cache, in bpf_local_storage_map_alloc() argument
839 smap->cache_idx = bpf_local_storage_cache_idx_get(cache); in bpf_local_storage_map_alloc()
849 struct bpf_local_storage_cache *cache, in bpf_local_storage_map_free() argument
858 bpf_local_storage_cache_idx_free(cache, smap->cache_idx); in bpf_local_storage_map_free()