diff --git a/src/sys/ubixfs/dirCache.c b/src/sys/ubixfs/dirCache.c index d8cfa47..c76933e 100644 --- a/src/sys/ubixfs/dirCache.c +++ b/src/sys/ubixfs/dirCache.c @@ -38,7 +38,7 @@ struct directoryEntry * ubixfs_findName(struct directoryEntry * dirList, uInt32 size, char * name) { unsigned int i; -kprintf("in findname: %s\n", name); + if (dirList == NULL || name == NULL) return NULL; for (i = 0; i < (size / sizeof(struct directoryEntry)) ; i++) { if (strcmp(dirList[i].fileName, name) == 0) return &dirList[i]; @@ -53,7 +53,7 @@ unsigned int i = 0x0; char dirName[256]; char * nextDir = NULL; -kprintf("looking for %s\n", name); +/* kprintf("looking for %s\n", name); */ assert(name); assert(head); assert(*name); @@ -84,12 +84,12 @@ * name points to a null terminated directory name * if nextDir isn't null, then make sure that this dir is present */ -kprintf("nextdir: %s -- dirName: %s\n", nextDir, dirName); +/* kprintf("nextdir: %s -- dirName: %s\n", nextDir, dirName); */ if (*nextDir != '\0') { while (tmp != NULL) { -kprintf("looking at: %s ... ", tmp->name); + if (strcmp(tmp->name, dirName) == 0) { -kprintf("found %s\n", tmp->name); + if ((*tmp->attributes & typeFile) == typeFile || tmp->fileListHead == NULL) { @@ -97,19 +97,17 @@ dirList = ubixfs_findName((struct directoryEntry *)head->info, *head->size, nextDir); if (dirList == NULL) return NULL; -kprintf("creating new node %s", dirList->fileName); +/* kprintf("creating new node %s", dirList->fileName); */ tmp = ubixfs_cacheAdd(tmp, ubixfs_cacheNew(dirList->fileName)); tmp->attributes = &dirList->attributes; tmp->permissions = &dirList->permissions; tmp->size = &dirList->size; -kprintf(" size: %d\n", *tmp->size); +/* kprintf(" size: %d\n", *tmp->size); */ tmp->startCluster = &dirList->startCluster; tmp->present = 0; return tmp; } else { - kprintf("descending and looking for: %s\n", nextDir); return ubixfs_cacheFind(tmp->fileListHead, nextDir); - kprintf("you should never see this\n"); } } /* if */ tmp = tmp->next; @@ -123,11 +121,11 @@ * dir listing here */ while (tmp != NULL) { -kprintf("bottom level looking at: %s\n", tmp->name); + assert(tmp->name); /* don't forget to check to see if it's a directory */ if (strcmp(tmp->name, name) == 0) { -kprintf("bottom level returning %s\n", tmp->name); + /* * we found the node. Move it to the front of the list * (if it isn't already) @@ -154,19 +152,19 @@ tmp = tmp->next; } /* while */ /* if we're here, then one level of the dir isn't cached */ -kprintf("file/dir isn't cached!\n"); + tmp = head->parent; assert(tmp); assert(tmp->info); dirList = ubixfs_findName((struct directoryEntry *)tmp->info, *tmp->size, name); if (dirList == NULL) return NULL; -kprintf("creating new node/size %s/%d", dirList->fileName, dirList->size); +/* kprintf("creating new node/size %s/%d", dirList->fileName, dirList->size);*/ tmp = ubixfs_cacheAdd(tmp, ubixfs_cacheNew(dirList->fileName)); tmp->attributes = &dirList->attributes; tmp->permissions = &dirList->permissions; tmp->size = &dirList->size; -kprintf(" size: %d\n", *tmp->size); +/* kprintf(" size: %d\n", *tmp->size); */ tmp->startCluster = &dirList->startCluster; tmp->present = 0; return tmp; @@ -252,6 +250,9 @@ /*** $Log$ + Revision 1.24 2004/07/27 12:02:01 reddawg + chg: fixed marks bug readFile did a lookup which is why it looked like it was loopping so much + Revision 1.23 2004/07/27 09:05:43 flameshadow chg: fixed file not found bug. Still can't find looping issue @@ -305,6 +306,9 @@ Revision 1.5 2004/07/20 19:21:30 reddawg You like leaving out $Log$ + You like leaving out Revision 1.24 2004/07/27 12:02:01 reddawg + You like leaving out chg: fixed marks bug readFile did a lookup which is why it looked like it was loopping so much + You like leaving out You like leaving out Revision 1.23 2004/07/27 09:05:43 flameshadow You like leaving out chg: fixed file not found bug. Still can't find looping issue You like leaving out diff --git a/src/sys/ubixfs/ubixfs.c b/src/sys/ubixfs/ubixfs.c index f625fd4..5e9650c 100644 --- a/src/sys/ubixfs/ubixfs.c +++ b/src/sys/ubixfs/ubixfs.c @@ -50,7 +50,7 @@ //struct directoryEntry * dirEntry = NULL; struct ubixFSInfo *fsInfo = fd->mp->fsInfo; -kprintf("openFileUbixFS(%s), cwd: %s\n", file, _current->oInfo.cwd); +/* kprintf("openFileUbixFS(%s), cwd: %s\n", file, _current->oInfo.cwd); */ if (fsInfo->dirCache == NULL) kprintf("dirCache is null!\n"); assert(fd); @@ -73,7 +73,7 @@ if (cacheNode == NULL) return 0; if (cacheNode->present == 1) break; if (*cacheNode->size != 0 && cacheNode->info == NULL) { - kprintf("allocating space for %s\n", cacheNode->name); + kprintf("caching name(size): %s(%d)\n", cacheNode->name, *cacheNode->size); cacheNode->info = kmalloc(UBIXFS_ALIGN(*cacheNode->size)); fd->size = *cacheNode->size; @@ -83,47 +83,8 @@ *cacheNode->startCluster); cacheNode->present = 1; } /* if */ -kprintf("looping in do while(1)\n"); } while(1); -#if 0 - /* - UBU - */ - do { - /* - */ - cacheNode = ubixfs_cacheFind(fsInfo->dirCache, file); - if (cacheNode == NULL) return 0; - /* - UBU - */ - if (cacheNode->present == 1) break; - /* - */ - /* one level of the cache wasn't loaded */ - /* - UBU - */ - if (cacheNode->size != 0 && cacheNode->info == NULL) { - kprintf("allocating space for %s\n", cacheNode->name); - cacheNode->info = kmalloc(UBIXFS_ALIGN(*cacheNode->size)); - fd->size = *cacheNode->size; /* */ /* UBU what is the best way to keep these in sync? */ - /* - UBU - */ - ubixfs_loadData(fd, - cacheNode->info, - *cacheNode->size, - *cacheNode->startCluster); - cacheNode->present = 1; - } /* if */ - /* - UBU - */ - } while (1); - /* - */ -#endif + assert(cacheNode); if (cacheNode == NULL) return 0; @@ -570,6 +531,9 @@ /*** $Log$ + Revision 1.38 2004/07/27 12:02:01 reddawg + chg: fixed marks bug readFile did a lookup which is why it looked like it was loopping so much + Revision 1.37 2004/07/27 09:05:43 flameshadow chg: fixed file not found bug. Still can't find looping issue diff --git a/src/sys/vfs/file.c b/src/sys/vfs/file.c index a73bc28..3fda578 100644 --- a/src/sys/vfs/file.c +++ b/src/sys/vfs/file.c @@ -222,7 +222,7 @@ i++; } /* Search For The File */ -kprintf("vfsOpenFile(%s)\n", path); + if (tmpFd->mp->fs->vfsOpenFile((char *)path,tmpFd) == 1) { /* If The File Is Found Then Set Up The Descriptor */ tmpFd->buffer = (char *)kmalloc(4096); @@ -262,6 +262,9 @@ /*** $Log$ + Revision 1.14 2004/07/27 04:05:20 flameshadow + chg: kinda fixed it. Added bunches of debug info + Revision 1.13 2004/07/23 09:10:06 reddawg ubixfs: cleaned up some functions played with the caching a bit vfs: renamed a bunch of functions