Lines Matching defs:owner

27 static int mem_charge(struct bpf_local_storage_map *smap, void *owner, u32 size)
34 return map->ops->map_local_storage_charge(smap, owner, size);
37 static void mem_uncharge(struct bpf_local_storage_map *smap, void *owner,
43 map->ops->map_local_storage_uncharge(smap, owner, size);
47 owner_storage(struct bpf_local_storage_map *smap, void *owner)
51 return map->ops->map_owner_storage_ptr(owner);
75 bpf_selem_alloc(struct bpf_local_storage_map *smap, void *owner,
80 if (mem_charge(smap, owner, smap->elem_size))
103 mem_uncharge(smap, owner, smap->elem_size);
269 void *owner;
272 owner = local_storage->owner;
274 /* All uncharging on the owner must be done first.
275 * The owner may be freed once the last selem is unlinked
278 mem_uncharge(smap, owner, smap->elem_size);
283 mem_uncharge(smap, owner, sizeof(struct bpf_local_storage));
284 local_storage->owner = NULL;
286 /* After this RCU_INIT, owner may be freed and cannot be used */
287 RCU_INIT_POINTER(*owner_storage(smap, owner), NULL);
420 int bpf_local_storage_alloc(void *owner,
429 err = mem_charge(smap, owner, sizeof(*storage));
447 storage->owner = owner;
454 (struct bpf_local_storage **)owner_storage(smap, owner);
455 /* Publish storage to the owner.
456 * Instead of using any lock of the kernel object (i.e. owner),
460 * From now on, the owner->storage pointer (e.g. sk->sk_bpf_storage)
462 * the owner->storage, the storage->lock must be held before
463 * setting owner->storage ptr to NULL.
476 mem_uncharge(smap, owner, sizeof(*storage));
486 bpf_local_storage_update(void *owner, struct bpf_local_storage_map *smap,
506 local_storage = rcu_dereference_check(*owner_storage(smap, owner),
509 /* Very first elem for the owner */
514 selem = bpf_selem_alloc(smap, owner, value, swap_uptrs, gfp_flags);
518 err = bpf_local_storage_alloc(owner, smap, selem, gfp_flags);
521 mem_uncharge(smap, owner, smap->elem_size);
548 alloc_selem = selem = bpf_selem_alloc(smap, owner, value, swap_uptrs, gfp_flags);
595 mem_uncharge(smap, owner, smap->elem_size);
781 * to the owner->storage or to the map bucket's list.