Lines Matching defs:map

75 /* Number of times to try to update a map before giving up */
90 map_ctrl *map;
92 /* Lock the map */
93 map = get_map_ctrl(db);
94 if (map == NULL)
97 free_map_ctrl(map);
116 map_ctrl *map;
118 /* Lock the map */
119 map = get_map_ctrl(db);
120 if (map == NULL)
122 if (1 != lock_map_ctrl(map))
126 /* Delete from and ttl map. Not a huge disaster if it fails. */
127 dbm_delete(map->ttl, key);
130 ret = dbm_delete(map->entries, key);
132 unlock_map_ctrl(map);
152 map_ctrl *map;
154 /* Lock the map */
155 map = get_map_ctrl(db);
156 if (map == NULL)
158 if (1 != lock_map_ctrl(map))
162 if (SUCCESS == update_entry_if_required(map, &key)) {
164 ret = dbm_fetch(map->entries, key);
168 ret = dbm_fetch(map->entries, key);
171 unlock_map_ctrl(map);
191 map_ctrl *map;
193 /* Get the map control block */
194 map = get_map_ctrl(db);
195 if (map == NULL)
199 ret = dbm_fetch(map->entries, key);
207 * DESCRIPTION: Get firstkey in an enumeration. If the map is out of date then
223 map_ctrl *map;
225 /* Lock the map */
226 map = get_map_ctrl(db);
227 if (map == NULL)
229 if (1 != lock_map_ctrl(map))
236 * until the right map has been updated.
238 for (count = 0; has_map_expired(map) &&
241 * Ideally ypxfr should wait for the map update
244 * because if there is a large map update the client
248 update_map_if_required(map, wait_flag);
267 dbm_close(map->entries);
268 dbm_close(map->ttl);
269 if (FAILURE == open_yptol_files(map)) {
281 "Cannot update map %s", map->map_name);
284 ret = dbm_firstkey(map->entries);
288 set_key_data(map, &ret);
290 unlock_map_ctrl(map);
310 map_ctrl *map;
312 /* Lock the map */
313 map = get_map_ctrl(db);
314 if (map == NULL)
316 if (1 != lock_map_ctrl(map))
319 ret = dbm_nextkey(map->entries);
323 set_key_data(map, &ret);
326 unlock_map_ctrl(map);
351 map_ctrl *map;
353 /* Lock the map */
354 map = get_map_ctrl(db);
355 if (map == NULL)
357 if (1 != lock_map_ctrl(map))
360 ret = dbm_do_nextkey(map->entries, inkey);
364 set_key_data(map, &ret);
367 unlock_map_ctrl(map);
382 map_ctrl *map;
385 /* Find or create map_ctrl for this map */
386 map = create_map_ctrl((char *)file);
388 if (map == NULL)
391 /* Lock map */
392 if (1 != lock_map_ctrl(map))
396 map->open_flags = open_flags;
397 map->open_mode = file_mode;
400 ret = open_yptol_files(map);
404 * equivalent old style map file has not been
408 check_old_map_date(map);
411 /* Open entries map */
412 map->entries = dbm_open(map->map_path, map->open_flags,
413 map->open_mode);
415 if (NULL != map->entries)
421 unlock_map_ctrl(map);
422 free_map_ctrl(map);
426 unlock_map_ctrl(map);
430 return ((DBM *)map);
454 map_ctrl *map;
456 /* Get map name */
457 map = get_map_ctrl(db);
458 if (map == NULL)
463 if (!write_to_dit(map->map_name, map->domain, key, content,
468 /* Lock the map */
469 if (1 != lock_map_ctrl(map))
473 if (!is_map_updating(map)) {
474 ret = dbm_store(map->entries, key, content,
479 update_entry_ttl(map, &key, TTL_RAND);
482 ret = dbm_store(map->entries, key, content, store_mode);
485 unlock_map_ctrl(map);
552 * DESCRIPTION: Checks that an old style map has not been updated. If it has
556 * GIVEN : A map_ctrl containing details of the NEW STYLE map.
561 check_old_map_date(map_ctrl *map)
569 if (0 != stat(map->trad_map_path, &stats)) {
571 * No problem. We have a new style map but no old style map
578 /* Set up datum with key for recorded old map update time */
581 value = dbm_fetch(map->ttl, key);
600 "mode. This will NOT initiate a NIS map push. In "
606 * a valid old map date (no problem, maybe this is the first time we
607 * checked). In either case the old map date entry must be update.
611 dbm_store(map->ttl, key, value, DBM_REPLACE);
617 * DESCRIPTION: Initializes all the systems related to map locking. This must
621 * not wait for map updates to complete, or other NIS components
641 /* Init map locks */