Lines Matching defs:map

29  * DESCRIPTION: Contains the map update thread and related code.
71 * GIVEN : Pointer to the open map ctrl
81 update_entry_if_required(map_ctrl *map, datum *key)
84 /* Only update individual entries if entire map is */
86 if (is_map_updating(map))
91 * the map is in need of an update. If it is then fake a
92 * recent order. The client will then read the map, using
96 if (has_map_expired(map))
97 update_timestamp(map->entries);
105 if (!has_entry_expired(map, key))
110 return (update_from_dit(map, key));
118 * INPUTS: Map control structure for an open map
127 update_from_dit(map_ctrl *map, datum *key)
135 * update the entire map instead.
137 if ((0 == strcmp(map->map_name, NETGROUP_BYHOST)) ||
138 (0 == strcmp(map->map_name, NETGROUP_BYUSER))) {
139 return (update_map_if_required(map, FALSE));
143 ret = read_from_dit(map->map_name, map->domain, key, &dat);
170 dbm_delete(map->entries, *key);
171 dbm_delete(map->ttl, *key);
178 res = dbm_store(map->entries, *key, dat, DBM_REPLACE);
185 update_entry_ttl(map, key, TTL_RUNNING);
193 * DESCRIPTION: Called to update an entire map if it is out of date. Map ctrl
195 * the map is already being updated. It is important that this is
198 * INPUTS: Map control structure for an open map
205 update_map_if_required(map_ctrl *map, bool_t wait)
218 unlock_map_ctrl(map);
219 res = lock_map_update(map);
220 lock_map_ctrl(map);
223 "Could not lock map %s for update",
224 map->map_name);
229 switch (try_lock_map_update(map)) {
253 * nobody beat us to the map update while we were getting it.
255 if (!has_map_expired(map)) {
257 unlock_map_update(map);
275 new_map = dup_map_ctrl(map);
277 unlock_map_update(map);
282 * While thread is running unlock map so other processes can
285 unlock_map_ctrl(map);
302 unlock_map_update(map);
303 if (SUCCESS != lock_map_ctrl(map))
305 "Could not acquire update lock for %s", map->map_name);
315 if (1 != lock_map_ctrl(map)) {
317 "Could not re-acquire lock for %s", map->map_name);
327 * DESCRIPTION: The update thread this is called to update an entire NIS map.
333 * map ctrl an possibly deadlocking.
344 map_ctrl *map;
347 map = (map_ctrl *)arg;
350 if (SUCCESS == update_map_from_dit(map, FALSE))
354 unlock_map_update(map);
357 free_map_ctrl(map);