Lines Matching refs:map

93 	map_ctrl *map;  in shim_dbm_close()  local
96 map = get_map_ctrl(db); in shim_dbm_close()
97 if (map == NULL) in shim_dbm_close()
100 free_map_ctrl(map); in shim_dbm_close()
119 map_ctrl *map; in shim_dbm_delete() local
122 map = get_map_ctrl(db); in shim_dbm_delete()
123 if (map == NULL) in shim_dbm_delete()
125 if (1 != lock_map_ctrl(map)) in shim_dbm_delete()
130 dbm_delete(map->ttl, key); in shim_dbm_delete()
133 ret = dbm_delete(map->entries, key); in shim_dbm_delete()
135 unlock_map_ctrl(map); in shim_dbm_delete()
155 map_ctrl *map; in shim_dbm_fetch() local
158 map = get_map_ctrl(db); in shim_dbm_fetch()
159 if (map == NULL) in shim_dbm_fetch()
161 if (1 != lock_map_ctrl(map)) in shim_dbm_fetch()
165 if (SUCCESS == update_entry_if_required(map, &key)) { in shim_dbm_fetch()
167 ret = dbm_fetch(map->entries, key); in shim_dbm_fetch()
171 ret = dbm_fetch(map->entries, key); in shim_dbm_fetch()
174 unlock_map_ctrl(map); in shim_dbm_fetch()
194 map_ctrl *map; in shim_dbm_fetch_noupdate() local
197 map = get_map_ctrl(db); in shim_dbm_fetch_noupdate()
198 if (map == NULL) in shim_dbm_fetch_noupdate()
202 ret = dbm_fetch(map->entries, key); in shim_dbm_fetch_noupdate()
226 map_ctrl *map; in shim_dbm_firstkey() local
229 map = get_map_ctrl(db); in shim_dbm_firstkey()
230 if (map == NULL) in shim_dbm_firstkey()
232 if (1 != lock_map_ctrl(map)) in shim_dbm_firstkey()
241 for (count = 0; has_map_expired(map) && in shim_dbm_firstkey()
251 update_map_if_required(map, wait_flag); in shim_dbm_firstkey()
270 dbm_close(map->entries); in shim_dbm_firstkey()
271 dbm_close(map->ttl); in shim_dbm_firstkey()
272 if (FAILURE == open_yptol_files(map)) { in shim_dbm_firstkey()
284 "Cannot update map %s", map->map_name); in shim_dbm_firstkey()
287 ret = dbm_firstkey(map->entries); in shim_dbm_firstkey()
291 set_key_data(map, &ret); in shim_dbm_firstkey()
293 unlock_map_ctrl(map); in shim_dbm_firstkey()
313 map_ctrl *map; in shim_dbm_nextkey() local
316 map = get_map_ctrl(db); in shim_dbm_nextkey()
317 if (map == NULL) in shim_dbm_nextkey()
319 if (1 != lock_map_ctrl(map)) in shim_dbm_nextkey()
322 ret = dbm_nextkey(map->entries); in shim_dbm_nextkey()
326 set_key_data(map, &ret); in shim_dbm_nextkey()
329 unlock_map_ctrl(map); in shim_dbm_nextkey()
354 map_ctrl *map; in shim_dbm_do_nextkey() local
357 map = get_map_ctrl(db); in shim_dbm_do_nextkey()
358 if (map == NULL) in shim_dbm_do_nextkey()
360 if (1 != lock_map_ctrl(map)) in shim_dbm_do_nextkey()
363 ret = dbm_do_nextkey(map->entries, inkey); in shim_dbm_do_nextkey()
367 set_key_data(map, &ret); in shim_dbm_do_nextkey()
370 unlock_map_ctrl(map); in shim_dbm_do_nextkey()
385 map_ctrl *map; in shim_dbm_open() local
389 map = create_map_ctrl((char *)file); in shim_dbm_open()
391 if (map == NULL) in shim_dbm_open()
395 if (1 != lock_map_ctrl(map)) in shim_dbm_open()
399 map->open_flags = open_flags; in shim_dbm_open()
400 map->open_mode = file_mode; in shim_dbm_open()
403 ret = open_yptol_files(map); in shim_dbm_open()
411 check_old_map_date(map); in shim_dbm_open()
415 map->entries = dbm_open(map->map_path, map->open_flags, in shim_dbm_open()
416 map->open_mode); in shim_dbm_open()
418 if (NULL != map->entries) in shim_dbm_open()
424 unlock_map_ctrl(map); in shim_dbm_open()
425 free_map_ctrl(map); in shim_dbm_open()
429 unlock_map_ctrl(map); in shim_dbm_open()
433 return ((DBM *)map); in shim_dbm_open()
457 map_ctrl *map; in shim_dbm_store() local
460 map = get_map_ctrl(db); in shim_dbm_store()
461 if (map == NULL) in shim_dbm_store()
466 if (!write_to_dit(map->map_name, map->domain, key, content, in shim_dbm_store()
472 if (1 != lock_map_ctrl(map)) in shim_dbm_store()
476 if (!is_map_updating(map)) { in shim_dbm_store()
477 ret = dbm_store(map->entries, key, content, in shim_dbm_store()
482 update_entry_ttl(map, &key, TTL_RAND); in shim_dbm_store()
485 ret = dbm_store(map->entries, key, content, store_mode); in shim_dbm_store()
488 unlock_map_ctrl(map); in shim_dbm_store()
563 check_old_map_date(map_ctrl *map) in check_old_map_date() argument
571 if (0 != stat(map->trad_map_path, &stats)) { in check_old_map_date()
583 value = dbm_fetch(map->ttl, key); in check_old_map_date()
613 dbm_store(map->ttl, key, value, DBM_REPLACE); in check_old_map_date()