diff --git a/BUGS b/BUGS index 16e23ae..7819902 100644 --- a/BUGS +++ b/BUGS @@ -12,3 +12,7 @@ formatting: file.c filewrite leaks onto next page need to fix PAGEBREAK mechanism +fs.c: grep XXX + +sysfile.c: why does mknod take a type argument? + diff --git a/fs.c b/fs.c index 69bfd8f..e47b6fa 100644 --- a/fs.c +++ b/fs.c @@ -524,11 +524,11 @@ dirlink(struct inode *dp, char *name, uint ino) { int off; struct dirent de; - struct uinode *ip; + struct uinode *ipu; // Check that name is not present. - if((ip = dirlookup(dp, name, 0)) != 0){ - iput(ip); + if((ipu = dirlookup(dp, name, 0)) != 0){ + iput(ipu); return -1; } @@ -593,43 +593,39 @@ skipelem(char *path, char *name) static struct uinode* _namei(char *path, int parent, char *name) { - struct uinode *dp, *ip; - struct inode *dpl; + struct uinode *dpu, *ipu; + struct inode *dp; uint off; if(*path == '/') - dp = iget(ROOTDEV, 1); + dpu = iget(ROOTDEV, 1); else - dp = idup(cp->cwd); + dpu = idup(cp->cwd); while((path = skipelem(path, name)) != 0){ - dpl = ilock(dp); - if(dpl->type != T_DIR){ - iunlock(dpl); - iput(dp); + dp = ilock(dpu); + if(dp->type != T_DIR){ + iput(iunlock(dp)); return 0; } if(parent && *path == '\0'){ // Stop one level early. - iunlock(dpl); - return dp; + iunlock(dp); + return dpu; } - if((ip = dirlookup(dpl, name, &off)) == 0){ - iunlock(dpl); - iput(dp); - iput(ip); + if((ipu = dirlookup(dp, name, &off)) == 0){ + iput(iunlock(dp)); + iput(ipu); return 0; } - - iunlock(dpl); - iput(dp); - dp = ip; + iput(iunlock(dp)); + dpu = ipu; } if(parent) return 0; - return dp; + return dpu; } struct uinode* diff --git a/runoff.list b/runoff.list index 5aa1d96..7abd23a 100644 --- a/runoff.list +++ b/runoff.list @@ -46,9 +46,9 @@ fsvar.h ide.c bio.c fs.c -exec.c file.c sysfile.c +exec.c # pipes pipe.c