Lines Matching defs:cache

104 /* cache functions */
171 * Locking: the cache is locked for the duration of this function.
187 * construction of a new cache, destruction of any old cache data,
190 * Locking: the cache is locked for the duration of this function.
204 "FILESYS: failed to synchronize cache (%s).\n",
218 * Manually walk through the cache, unregistering all the special
221 * Locking: the cache is locked throughout the execution of this
222 * routine because it reads and modifies cache links continuously.
236 /* Unregister everything in the cache */
246 /* Destroy the cache */
282 /* Retrieve necessary info from the cache */
294 "failed to look up \"%s\" in cache (%s).\n",
377 /* Retrieve necessary info from the cache */
403 /* Free up info retrieved from the cache */
430 /* Retrieve necessary info from the cache */
473 /* Retrieve necessary info from the cache */
683 * This routine constructs a new cache of the current mnttab file.
685 * Locking: the cache must be locked prior to calling this function.
687 * Return Values: NULL with errno set on failure, new cache point on
694 cache_t *cache;
720 /* Allocate a new empty cache */
721 if ((cache = (cache_t *)calloc(1, sizeof (cache_t))) == NULL) {
723 "FILESYS: failed to allocate cache (%s).\n",
728 cache->hash_size = size;
729 cache->timestamp = st.st_mtime;
732 cache->mounts = (hashentry_t **)calloc(size, sizeof (hashentry_t *));
733 if (cache->mounts == NULL) {
737 free_cache(&cache);
747 free_cache(&cache);
752 /* Insert each mnttab entry into the cache */
760 if (cache_insert(cache, &mt) < 0) {
762 "FILESYS: cache insertion failure (%s).\n",
764 free_cache(&cache);
774 return (cache);
780 * Free up all the memory associated with a cache.
782 * Locking: the cache must be locked before calling this function.
817 * Locking: the cache must be locked before calling this function.
855 * Resynchronize the mnttab cache with the mnttab file.
857 * Locking: the cache must be locked before calling this function.
878 /* Do nothing if there's already an up-to-date cache */
887 "FILESYS: failed to stat \"%s\", cache is stale "
894 /* Create a new cache based on the new mnttab file. */
897 "FILESYS: failed creating cache, cache is stale (%s).\n",
903 /* Register any specials found in the new cache but not the old one */
913 /* Pass the new cache pointer to the calling function */
916 /* If there wasn't an old cache, return successfully now */
921 * If there was an old cache, then unregister whatever specials it
922 * contains that aren't in the new cache. And then destroy the old
923 * cache.
941 * Given a cache and a mnttab entry, this routine inserts that entry in
942 * the cache. The mnttab entry's special device and filesystem type
943 * is added to the 'mounts' hashtable of the cache, and the entry's
947 * Locking: the cache must be locked before calling this function.
952 cache_insert(cache_t *cache, struct mnttab *mt)
959 if ((cache == NULL) ||
960 (cache->mounts == NULL) ||
981 index = hash(cache->hash_size, mt->mnt_special);
982 for (entry = cache->mounts[index]; entry != NULL; entry = entry->next) {
998 entry->next = cache->mounts[index];
999 cache->mounts[index] = entry;
1023 cache->mounts[index] = entry->next;
1041 * Locking: the cache must be locked before calling this function.
1044 * cache entry when successful.
1047 cache_lookup(cache_t *cache, char *rsrc)
1053 if ((cache == NULL) || (cache->mounts == NULL) || (rsrc == NULL)) {
1059 index = hash(cache->hash_size, rsrc);
1060 if (cache->mounts[index]) {
1061 for (entry = cache->mounts[index]; entry != NULL;
1215 * given hashtable entry from the cache.
1361 * in the cache and extract a separate list of dependents for that
1365 * Locking: the cache is locked for the whole duration of this function.
1375 "FILESYS: failed looking up \"%s\" in cache (%s).\n",