Lines Matching refs:entry
25 static void sys_hashmap_sc_entry_init(struct sys_hashmap_sc_entry *entry, uint64_t key, in sys_hashmap_sc_entry_init() argument
28 entry->key = key; in sys_hashmap_sc_entry_init()
29 entry->value = value; in sys_hashmap_sc_entry_init()
30 sys_dnode_init(&entry->node); in sys_hashmap_sc_entry_init()
33 static void sys_hashmap_sc_insert_entry(struct sys_hashmap *map, struct sys_hashmap_sc_entry *entry) in sys_hashmap_sc_insert_entry() argument
36 uint32_t hash = map->hash_func(&entry->key, sizeof(entry->key)); in sys_hashmap_sc_insert_entry()
38 sys_dlist_append(&buckets[hash % map->data->n_buckets], &entry->node); in sys_hashmap_sc_insert_entry()
45 struct sys_hashmap_sc_entry *entry; in sys_hashmap_sc_insert_all() local
48 entry = CONTAINER_OF(sys_dlist_get(list), struct sys_hashmap_sc_entry, node); in sys_hashmap_sc_insert_all()
49 sys_hashmap_sc_insert_entry(map, entry); in sys_hashmap_sc_insert_all()
56 struct sys_hashmap_sc_entry *entry; in sys_hashmap_sc_to_list() local
64 entry = CONTAINER_OF(sys_dlist_get(bucket), struct sys_hashmap_sc_entry, in sys_hashmap_sc_to_list()
66 sys_dlist_append(list, &entry->node); in sys_hashmap_sc_to_list()
114 struct sys_hashmap_sc_entry *entry; in sys_hashmap_sc_find() local
126 SYS_DLIST_FOR_EACH_CONTAINER(bucket, entry, node) { in sys_hashmap_sc_find()
127 if (entry->key == key) { in sys_hashmap_sc_find()
128 return entry; in sys_hashmap_sc_find()
139 struct sys_hashmap_sc_entry *entry; in sys_hashmap_sc_iter_next() local
153 SYS_DLIST_FOR_EACH_CONTAINER(bucket, entry, node) { in sys_hashmap_sc_iter_next()
155 if (entry->key == it->key) { in sys_hashmap_sc_iter_next()
165 it->key = entry->key; in sys_hashmap_sc_iter_next()
166 it->value = entry->value; in sys_hashmap_sc_iter_next()
194 struct sys_hashmap_sc_entry *entry; in sys_hashmap_sc_clear() local
208 entry = CONTAINER_OF(sys_dlist_get(&list), struct sys_hashmap_sc_entry, node); in sys_hashmap_sc_clear()
212 cb(entry->key, entry->value, cookie); in sys_hashmap_sc_clear()
216 map->alloc_func(entry, 0); in sys_hashmap_sc_clear()
224 struct sys_hashmap_sc_entry *entry; in sys_hashmap_sc_insert() local
226 entry = sys_hashmap_sc_find(map, key); in sys_hashmap_sc_insert()
227 if (entry != NULL) { in sys_hashmap_sc_insert()
229 *old_value = entry->value; in sys_hashmap_sc_insert()
232 entry->value = value; in sys_hashmap_sc_insert()
242 entry = map->alloc_func(NULL, sizeof(*entry)); in sys_hashmap_sc_insert()
243 if (entry == NULL) { in sys_hashmap_sc_insert()
247 sys_hashmap_sc_entry_init(entry, key, value); in sys_hashmap_sc_insert()
248 sys_hashmap_sc_insert_entry(map, entry); in sys_hashmap_sc_insert()
256 struct sys_hashmap_sc_entry *entry; in sys_hashmap_sc_remove() local
258 entry = sys_hashmap_sc_find(map, key); in sys_hashmap_sc_remove()
259 if (entry == NULL) { in sys_hashmap_sc_remove()
264 *value = entry->value; in sys_hashmap_sc_remove()
267 sys_dlist_remove(&entry->node); in sys_hashmap_sc_remove()
275 map->alloc_func(entry, 0); in sys_hashmap_sc_remove()
282 struct sys_hashmap_sc_entry *entry; in sys_hashmap_sc_get() local
284 entry = sys_hashmap_sc_find(map, key); in sys_hashmap_sc_get()
285 if (entry == NULL) { in sys_hashmap_sc_get()
290 *value = entry->value; in sys_hashmap_sc_get()