Lines Matching defs:map
78 /* Number of times to try to update a map before giving up */
93 map_ctrl *map;
95 /* Lock the map */
96 map = get_map_ctrl(db);
97 if (map == NULL)
100 free_map_ctrl(map);
119 map_ctrl *map;
121 /* Lock the map */
122 map = get_map_ctrl(db);
123 if (map == NULL)
125 if (1 != lock_map_ctrl(map))
129 /* Delete from and ttl map. Not a huge disaster if it fails. */
130 dbm_delete(map->ttl, key);
133 ret = dbm_delete(map->entries, key);
135 unlock_map_ctrl(map);
155 map_ctrl *map;
157 /* Lock the map */
158 map = get_map_ctrl(db);
159 if (map == NULL)
161 if (1 != lock_map_ctrl(map))
165 if (SUCCESS == update_entry_if_required(map, &key)) {
167 ret = dbm_fetch(map->entries, key);
171 ret = dbm_fetch(map->entries, key);
174 unlock_map_ctrl(map);
194 map_ctrl *map;
196 /* Get the map control block */
197 map = get_map_ctrl(db);
198 if (map == NULL)
202 ret = dbm_fetch(map->entries, key);
210 * DESCRIPTION: Get firstkey in an enumeration. If the map is out of date then
226 map_ctrl *map;
228 /* Lock the map */
229 map = get_map_ctrl(db);
230 if (map == NULL)
232 if (1 != lock_map_ctrl(map))
239 * until the right map has been updated.
241 for (count = 0; has_map_expired(map) &&
244 * Ideally ypxfr should wait for the map update
247 * because if there is a large map update the client
251 update_map_if_required(map, wait_flag);
270 dbm_close(map->entries);
271 dbm_close(map->ttl);
272 if (FAILURE == open_yptol_files(map)) {
284 "Cannot update map %s", map->map_name);
287 ret = dbm_firstkey(map->entries);
291 set_key_data(map, &ret);
293 unlock_map_ctrl(map);
313 map_ctrl *map;
315 /* Lock the map */
316 map = get_map_ctrl(db);
317 if (map == NULL)
319 if (1 != lock_map_ctrl(map))
322 ret = dbm_nextkey(map->entries);
326 set_key_data(map, &ret);
329 unlock_map_ctrl(map);
354 map_ctrl *map;
356 /* Lock the map */
357 map = get_map_ctrl(db);
358 if (map == NULL)
360 if (1 != lock_map_ctrl(map))
363 ret = dbm_do_nextkey(map->entries, inkey);
367 set_key_data(map, &ret);
370 unlock_map_ctrl(map);
385 map_ctrl *map;
388 /* Find or create map_ctrl for this map */
389 map = create_map_ctrl((char *)file);
391 if (map == NULL)
394 /* Lock map */
395 if (1 != lock_map_ctrl(map))
399 map->open_flags = open_flags;
400 map->open_mode = file_mode;
403 ret = open_yptol_files(map);
407 * equivalent old style map file has not been
411 check_old_map_date(map);
414 /* Open entries map */
415 map->entries = dbm_open(map->map_path, map->open_flags,
416 map->open_mode);
418 if (NULL != map->entries)
424 unlock_map_ctrl(map);
425 free_map_ctrl(map);
429 unlock_map_ctrl(map);
433 return ((DBM *)map);
457 map_ctrl *map;
459 /* Get map name */
460 map = get_map_ctrl(db);
461 if (map == NULL)
466 if (!write_to_dit(map->map_name, map->domain, key, content,
471 /* Lock the map */
472 if (1 != lock_map_ctrl(map))
476 if (!is_map_updating(map)) {
477 ret = dbm_store(map->entries, key, content,
482 update_entry_ttl(map, &key, TTL_RAND);
485 ret = dbm_store(map->entries, key, content, store_mode);
488 unlock_map_ctrl(map);
554 * DESCRIPTION: Checks that an old style map has not been updated. If it has
558 * GIVEN : A map_ctrl containing details of the NEW STYLE map.
563 check_old_map_date(map_ctrl *map)
571 if (0 != stat(map->trad_map_path, &stats)) {
573 * No problem. We have a new style map but no old style map
580 /* Set up datum with key for recorded old map update time */
583 value = dbm_fetch(map->ttl, key);
602 "mode. This will NOT initiate a NIS map push. In "
608 * a valid old map date (no problem, maybe this is the first time we
609 * checked). In either case the old map date entry must be update.
613 dbm_store(map->ttl, key, value, DBM_REPLACE);
619 * DESCRIPTION: Initializes all the systems related to map locking. This must
623 * not wait for map updates to complete, or other NIS components
643 /* Init map locks */