Lines Matching refs:smap

24 	struct bpf_local_storage_map *smap;  in bpf_sk_storage_lookup()  local
31 smap = (struct bpf_local_storage_map *)map; in bpf_sk_storage_lookup()
32 return bpf_local_storage_lookup(sk_storage, smap, cacheit_lockit); in bpf_sk_storage_lookup()
135 struct bpf_local_storage_map *smap, in bpf_sk_storage_clone_elem() argument
140 copy_selem = bpf_selem_alloc(smap, newsk, NULL, true, GFP_ATOMIC); in bpf_sk_storage_clone_elem()
144 if (btf_record_has_field(smap->map.record, BPF_SPIN_LOCK)) in bpf_sk_storage_clone_elem()
145 copy_map_value_locked(&smap->map, SDATA(copy_selem)->data, in bpf_sk_storage_clone_elem()
148 copy_map_value(&smap->map, SDATA(copy_selem)->data, in bpf_sk_storage_clone_elem()
171 struct bpf_local_storage_map *smap; in bpf_sk_storage_clone() local
174 smap = rcu_dereference(SDATA(selem)->smap); in bpf_sk_storage_clone()
175 if (!(smap->map.map_flags & BPF_F_CLONE)) in bpf_sk_storage_clone()
183 map = bpf_map_inc_not_zero(&smap->map); in bpf_sk_storage_clone()
187 copy_selem = bpf_sk_storage_clone_elem(newsk, smap, selem); in bpf_sk_storage_clone()
195 bpf_selem_link_map(smap, copy_selem); in bpf_sk_storage_clone()
198 ret = bpf_local_storage_alloc(newsk, smap, copy_selem, GFP_ATOMIC); in bpf_sk_storage_clone()
200 bpf_selem_free(copy_selem, smap, true); in bpf_sk_storage_clone()
201 atomic_sub(smap->elem_size, in bpf_sk_storage_clone()
275 static int bpf_sk_storage_charge(struct bpf_local_storage_map *smap, in bpf_sk_storage_charge() argument
291 static void bpf_sk_storage_uncharge(struct bpf_local_storage_map *smap, in bpf_sk_storage_uncharge() argument
547 struct bpf_local_storage_map *smap; in diag_get() local
556 smap = rcu_dereference(sdata->smap); in diag_get()
557 if (nla_put_u32(skb, SK_DIAG_BPF_STORAGE_MAP_ID, smap->map.id)) in diag_get()
561 smap->map.value_size, in diag_get()
566 if (btf_record_has_field(smap->map.record, BPF_SPIN_LOCK)) in diag_get()
567 copy_map_value_locked(&smap->map, nla_data(nla_value), in diag_get()
570 copy_map_value(&smap->map, nla_data(nla_value), sdata->data); in diag_get()
588 struct bpf_local_storage_map *smap; in bpf_sk_storage_diag_put_all() local
608 smap = rcu_dereference(SDATA(selem)->smap); in bpf_sk_storage_diag_put_all()
609 diag_size += nla_value_size(smap->map.value_size); in bpf_sk_storage_diag_put_all()
715 struct bpf_local_storage_map *smap; in bpf_sk_storage_map_seq_find_next() local
720 smap = (struct bpf_local_storage_map *)info->map; in bpf_sk_storage_map_seq_find_next()
721 n_buckets = 1U << smap->bucket_log; in bpf_sk_storage_map_seq_find_next()
733 b = &smap->buckets[bucket_id++]; in bpf_sk_storage_map_seq_find_next()
746 for (i = bucket_id; i < (1U << smap->bucket_log); i++) { in bpf_sk_storage_map_seq_find_next()
747 b = &smap->buckets[i]; in bpf_sk_storage_map_seq_find_next()