Lines Matching refs:key
64 static int map_hash(struct map *map, unsigned int key) in map_hash() argument
72 idx = key % map->size; in map_hash()
80 if (e->item->key == key) in map_hash()
91 int map_reput(struct map *map, unsigned int key, struct map_item *value, in map_reput() argument
96 while ((rc = map_hash(map, key)) < 0) { in map_reput()
109 map->data[rc].item->key = key; in map_reput()
114 int map_put(struct map *map, unsigned int key, struct map_item *value) in map_put() argument
116 return map_reput(map, key, value, NULL); in map_put()
139 rc = map_put(map, oldt[i].item->key, oldt[i].item); in map_rehash()
149 static struct map_entry *map_find(const struct map *map, unsigned int key) in map_find() argument
157 idx = key % map->size; in map_find()
167 if (e->item->key == key) in map_find()
173 int map_contains(const struct map *map, unsigned int key) in map_contains() argument
175 return (map_find(map, key) == NULL) ? 0 : 1; in map_contains()
178 struct map_item *map_get(const struct map *map, unsigned int key) in map_get() argument
182 e = map_find(map, key); in map_get()
188 int map_remove(struct map *map, unsigned int key) in map_remove() argument
192 e = map_find(map, key); in map_remove()