diff --git a/src/sys/ubixfs/dirCache.c b/src/sys/ubixfs/dirCache.c index 738361d..2713e2c 100644 --- a/src/sys/ubixfs/dirCache.c +++ b/src/sys/ubixfs/dirCache.c @@ -86,7 +86,8 @@ if (*nextDir != '\0') { while (tmp != NULL) { if (strcmp(tmp->name, dirName) == 0) { - if (tmp->fileListHead == NULL) { + if ((tmp->attributes & typeFile) == typeFile + || tmp->fileListHead == NULL) { /* if we're here, then there are no subdirs cached to look through */ dirList = ubixfs_findName((struct directoryEntry *)head->info,nextDir); if (dirList == NULL) return NULL; @@ -230,6 +231,9 @@ /*** $Log$ + Revision 1.16 2004/07/22 16:34:32 flameshadow + add: file and dir caching kinda work + Revision 1.15 2004/07/21 22:43:18 flameshadow one more try @@ -258,6 +262,9 @@ Revision 1.5 2004/07/20 19:21:30 reddawg You like leaving out $Log$ + You like leaving out Revision 1.16 2004/07/22 16:34:32 flameshadow + You like leaving out add: file and dir caching kinda work + You like leaving out You like leaving out Revision 1.15 2004/07/21 22:43:18 flameshadow You like leaving out one more try You like leaving out diff --git a/src/sys/ubixfs/ubixfs.c b/src/sys/ubixfs/ubixfs.c index 46c6723..2b03f0a 100644 --- a/src/sys/ubixfs/ubixfs.c +++ b/src/sys/ubixfs/ubixfs.c @@ -156,12 +156,22 @@ assert(fd->mp->device->devInfo->read); assert(fsInfo); assert(fsInfo->dirCache); - cacheNode = ubixfs_cacheFind(fsInfo->dirCache, file); + + do { + cacheNode = ubixfs_cacheFind(fsInfo->dirCache, file); + if (cacheNode == NULL) return 0; + if (cacheNode->present == 1) break; + /* one level of the cache wasn't loaded */ + if (cacheNode->size != 0 && cacheNode->info == NULL) { + kprintf("allocating space for %s\n", cacheNode->name); + cacheNode->info = kmalloc(cacheNode->size); + cacheNode->present = 1; + } /* if */ + } while (1); + assert(cacheNode); if (cacheNode == NULL) return 0; - dirEntry = (struct directoryEntry *)cacheNode->info; - if ((fd->mode & fileRead) == fileRead) { fd->start = cacheNode->startCluster; fd->size = cacheNode->size; @@ -459,6 +469,9 @@ /*** $Log$ + Revision 1.29 2004/07/22 16:34:32 flameshadow + add: file and dir caching kinda work + Revision 1.28 2004/07/21 22:07:18 flameshadow chg: renamed caching functions (again)