Lines Matching defs:map

30  * DESCRIPTION: Contains the map update thread and related code.
72 * GIVEN : Pointer to the open map ctrl
82 update_entry_if_required(map_ctrl *map, datum *key)
85 /* Only update individual entries if entire map is */
87 if (is_map_updating(map))
92 * the map is in need of an update. If it is then fake a
93 * recent order. The client will then read the map, using
97 if (has_map_expired(map))
98 update_timestamp(map->entries);
106 if (!has_entry_expired(map, key))
111 return (update_from_dit(map, key));
119 * INPUTS: Map control structure for an open map
128 update_from_dit(map_ctrl *map, datum *key)
136 * update the entire map instead.
138 if ((0 == strcmp(map->map_name, NETGROUP_BYHOST)) ||
139 (0 == strcmp(map->map_name, NETGROUP_BYUSER))) {
140 return (update_map_if_required(map, FALSE));
144 ret = read_from_dit(map->map_name, map->domain, key, &dat);
171 dbm_delete(map->entries, *key);
172 dbm_delete(map->ttl, *key);
179 res = dbm_store(map->entries, *key, dat, DBM_REPLACE);
186 update_entry_ttl(map, key, TTL_RUNNING);
194 * DESCRIPTION: Called to update an entire map if it is out of date. Map ctrl
196 * the map is already being updated. It is important that this is
199 * INPUTS: Map control structure for an open map
206 update_map_if_required(map_ctrl *map, bool_t wait)
219 unlock_map_ctrl(map);
220 res = lock_map_update(map);
221 lock_map_ctrl(map);
224 "Could not lock map %s for update",
225 map->map_name);
230 switch (try_lock_map_update(map)) {
254 * nobody beat us to the map update while we were getting it.
256 if (!has_map_expired(map)) {
258 unlock_map_update(map);
276 new_map = dup_map_ctrl(map);
278 unlock_map_update(map);
283 * While thread is running unlock map so other processes can
286 unlock_map_ctrl(map);
303 unlock_map_update(map);
304 if (SUCCESS != lock_map_ctrl(map))
306 "Could not acquire update lock for %s", map->map_name);
316 if (1 != lock_map_ctrl(map)) {
318 "Could not re-acquire lock for %s", map->map_name);
328 * DESCRIPTION: The update thread this is called to update an entire NIS map.
334 * map ctrl an possibly deadlocking.
345 map_ctrl *map;
348 map = (map_ctrl *)arg;
351 if (SUCCESS == update_map_from_dit(map, FALSE))
355 unlock_map_update(map);
358 free_map_ctrl(map);