local_storage
void __bpf_local_storage_insert_cache(struct bpf_local_storage *local_storage,
bpf_local_storage_lookup(struct bpf_local_storage *local_storage,
sdata = rcu_dereference_check(local_storage->cache[smap->cache_idx],
hlist_for_each_entry_rcu(selem, &local_storage->list, snode,
__bpf_local_storage_insert_cache(local_storage, smap, selem);
u32 bpf_local_storage_destroy(struct bpf_local_storage *local_storage);
void bpf_selem_link_storage_nolock(struct bpf_local_storage *local_storage,
struct bpf_local_storage *local_storage,
struct bpf_local_storage __rcu *local_storage;
struct bpf_local_storage *local_storage;
local_storage = rcu_dereference(cgroup->bpf_cgrp_storage);
if (!local_storage)
bpf_local_storage_destroy(local_storage);
struct bpf_local_storage *local_storage;
local_storage = rcu_dereference(bsb->storage);
if (!local_storage)
bpf_local_storage_destroy(local_storage);
struct bpf_local_storage *local_storage;
local_storage = container_of(rcu, struct bpf_local_storage, rcu);
kfree(local_storage);
static void __bpf_local_storage_free(struct bpf_local_storage *local_storage,
kfree_rcu(local_storage, rcu);
call_rcu_tasks_trace(&local_storage->rcu,
struct bpf_local_storage *local_storage;
local_storage = container_of(rcu, struct bpf_local_storage, rcu);
kfree_nolock(local_storage);
static void bpf_local_storage_free(struct bpf_local_storage *local_storage,
if (!local_storage)
if (!local_storage->use_kmalloc_nolock) {
__bpf_local_storage_free(local_storage, reuse_now);
call_rcu(&local_storage->rcu, bpf_local_storage_free_rcu);
call_rcu_tasks_trace(&local_storage->rcu,
struct bpf_local_storage *local_storage)
return &smap->buckets[hash_ptr(local_storage, smap->bucket_log)];
struct bpf_local_storage *local_storage,
void *owner = local_storage->owner;
if (rcu_access_pointer(local_storage->cache[smap->cache_idx]) ==
RCU_INIT_POINTER(local_storage->cache[smap->cache_idx], NULL);
if (pin_owner && !refcount_inc_not_zero(&local_storage->owner_refcnt))
uncharge += free_local_storage ? sizeof(*local_storage) : 0;
mem_uncharge(smap, local_storage->owner, uncharge);
local_storage->mem_charge -= uncharge;
local_storage->owner = NULL;
refcount_dec(&local_storage->owner_refcnt);
static bool bpf_selem_unlink_storage_nolock(struct bpf_local_storage *local_storage,
&local_storage->list);
bpf_selem_unlink_storage_nolock_misc(selem, smap, local_storage,
void bpf_selem_link_storage_nolock(struct bpf_local_storage *local_storage,
local_storage->mem_charge += smap->elem_size;
RCU_INIT_POINTER(selem->local_storage, local_storage);
hlist_add_head_rcu(&selem->snode, &local_storage->list);
struct bpf_local_storage *local_storage;
local_storage = rcu_dereference_check(selem->local_storage,
b = select_bucket(smap, local_storage);
struct bpf_local_storage *local_storage,
b = select_bucket(smap, local_storage);
struct bpf_local_storage *local_storage;
local_storage = rcu_dereference_check(selem->local_storage,
err = raw_res_spin_lock_irqsave(&local_storage->lock, flags);
local_storage, selem, &selem_free_list);
raw_res_spin_unlock_irqrestore(&local_storage->lock, flags);
bpf_local_storage_free(local_storage, false);
struct bpf_local_storage *local_storage;
local_storage = rcu_dereference_check(selem->local_storage, bpf_rcu_lock_held());
b = b ? : select_bucket(smap, local_storage);
if (local_storage) {
err = raw_res_spin_lock_irqsave(&local_storage->lock, flags);
&local_storage->list);
selem, smap, local_storage,
raw_res_spin_unlock_irqrestore(&local_storage->lock, flags);
RCU_INIT_POINTER(selem->local_storage, NULL);
bpf_local_storage_free(local_storage, true);
void __bpf_local_storage_insert_cache(struct bpf_local_storage *local_storage,
err = raw_res_spin_lock_irqsave(&local_storage->lock, flags);
rcu_assign_pointer(local_storage->cache[smap->cache_idx], SDATA(selem));
raw_res_spin_unlock_irqrestore(&local_storage->lock, flags);
struct bpf_local_storage *local_storage;
local_storage = rcu_dereference_check(*owner_storage(smap, owner),
if (!local_storage || hlist_empty(&local_storage->list)) {
bpf_local_storage_lookup(local_storage, smap, false);
err = raw_res_spin_lock_irqsave(&local_storage->lock, flags);
if (unlikely(hlist_empty(&local_storage->list))) {
old_sdata = bpf_local_storage_lookup(local_storage, smap, false);
b = select_bucket(smap, local_storage);
bpf_selem_link_storage_nolock(local_storage, selem);
bpf_selem_unlink_storage_nolock(local_storage, SELEM(old_sdata),
raw_res_spin_unlock_irqrestore(&local_storage->lock, flags);
u32 bpf_local_storage_destroy(struct bpf_local_storage *local_storage)
hlist_for_each_entry_rcu(selem, &local_storage->list, snode)
if (!refcount_dec_and_test(&local_storage->owner_refcnt)) {
while (refcount_read(&local_storage->owner_refcnt))
return local_storage->mem_charge;
struct bpf_local_storage *local_storage;
local_storage = rcu_dereference(task->bpf_storage);
if (!local_storage)
bpf_local_storage_destroy(local_storage);
rcu_dereference(copy_selem->local_storage);
sk_storage = rcu_dereference(selem->local_storage);
sk_storage = rcu_dereference(selem->local_storage);
sk_storage = rcu_dereference(selem->local_storage);
static int run_self_unlink(struct local_storage *skel, const char *rm_path)
struct local_storage *skel = NULL;
struct local_storage *storage;
struct local_storage *storage;
struct local_storage *storage;
struct local_storage *storage;
__type(value, struct local_storage);
__type(value, struct local_storage);
__type(value, struct local_storage);
__type(value, struct local_storage);
__type(value, struct local_storage);
struct local_storage *storage;