Lines Matching full:owner

27 static int mem_charge(struct bpf_local_storage_map *smap, void *owner, u32 size)  in mem_charge()  argument
34 return map->ops->map_local_storage_charge(smap, owner, size); in mem_charge()
37 static void mem_uncharge(struct bpf_local_storage_map *smap, void *owner, in mem_uncharge() argument
43 map->ops->map_local_storage_uncharge(smap, owner, size); in mem_uncharge()
47 owner_storage(struct bpf_local_storage_map *smap, void *owner) in owner_storage() argument
51 return map->ops->map_owner_storage_ptr(owner); in owner_storage()
75 bpf_selem_alloc(struct bpf_local_storage_map *smap, void *owner, in bpf_selem_alloc() argument
80 if (charge_mem && mem_charge(smap, owner, smap->elem_size)) in bpf_selem_alloc()
109 mem_uncharge(smap, owner, smap->elem_size); in bpf_selem_alloc()
259 void *owner; in bpf_selem_unlink_storage_nolock() local
262 owner = local_storage->owner; in bpf_selem_unlink_storage_nolock()
264 /* All uncharging on the owner must be done first. in bpf_selem_unlink_storage_nolock()
265 * The owner may be freed once the last selem is unlinked in bpf_selem_unlink_storage_nolock()
269 mem_uncharge(smap, owner, smap->elem_size); in bpf_selem_unlink_storage_nolock()
274 mem_uncharge(smap, owner, sizeof(struct bpf_local_storage)); in bpf_selem_unlink_storage_nolock()
275 local_storage->owner = NULL; in bpf_selem_unlink_storage_nolock()
277 /* After this RCU_INIT, owner may be freed and cannot be used */ in bpf_selem_unlink_storage_nolock()
278 RCU_INIT_POINTER(*owner_storage(smap, owner), NULL); in bpf_selem_unlink_storage_nolock()
474 int bpf_local_storage_alloc(void *owner, in bpf_local_storage_alloc() argument
483 err = mem_charge(smap, owner, sizeof(*storage)); in bpf_local_storage_alloc()
504 storage->owner = owner; in bpf_local_storage_alloc()
510 (struct bpf_local_storage **)owner_storage(smap, owner); in bpf_local_storage_alloc()
511 /* Publish storage to the owner. in bpf_local_storage_alloc()
512 * Instead of using any lock of the kernel object (i.e. owner), in bpf_local_storage_alloc()
516 * From now on, the owner->storage pointer (e.g. sk->sk_bpf_storage) in bpf_local_storage_alloc()
518 * the owner->storage, the storage->lock must be held before in bpf_local_storage_alloc()
519 * setting owner->storage ptr to NULL. in bpf_local_storage_alloc()
542 mem_uncharge(smap, owner, sizeof(*storage)); in bpf_local_storage_alloc()
552 bpf_local_storage_update(void *owner, struct bpf_local_storage_map *smap, in bpf_local_storage_update() argument
571 local_storage = rcu_dereference_check(*owner_storage(smap, owner), in bpf_local_storage_update()
574 /* Very first elem for the owner */ in bpf_local_storage_update()
579 selem = bpf_selem_alloc(smap, owner, value, true, gfp_flags); in bpf_local_storage_update()
583 err = bpf_local_storage_alloc(owner, smap, selem, gfp_flags); in bpf_local_storage_update()
586 mem_uncharge(smap, owner, smap->elem_size); in bpf_local_storage_update()
613 alloc_selem = selem = bpf_selem_alloc(smap, owner, value, true, gfp_flags); in bpf_local_storage_update()
659 mem_uncharge(smap, owner, smap->elem_size); in bpf_local_storage_update()
783 * get a hold of the owner PTR_TO_BTF_ID in any context. eg. bpf_get_current_task_btf.
785 * memory immediately. To be reuse-immediate safe, the owner destruction
873 * to the owner->storage or to the map bucket's list. in bpf_local_storage_map_free()