Merge branch 'master' of g.csail.mit.edu:xv6-dev
This commit is contained in:
commit
14270288b7
19 changed files with 181 additions and 172 deletions
11
fs.c
11
fs.c
|
@ -169,7 +169,7 @@ iinit(int dev)
|
|||
for(i = 0; i < NINODE; i++) {
|
||||
initsleeplock(&icache.inode[i].lock, "inode");
|
||||
}
|
||||
|
||||
|
||||
readsb(dev, &sb);
|
||||
cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\
|
||||
inodestart %d bmap start %d\n", sb.size, sb.nblocks,
|
||||
|
@ -451,13 +451,6 @@ readi(struct inode *ip, char *dst, uint off, uint n)
|
|||
for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
|
||||
bp = bread(ip->dev, bmap(ip, off/BSIZE));
|
||||
m = min(n - tot, BSIZE - off%BSIZE);
|
||||
/*
|
||||
cprintf("data off %d:\n", off);
|
||||
for (int j = 0; j < min(m, 10); j++) {
|
||||
cprintf("%x ", bp->data[off%BSIZE+j]);
|
||||
}
|
||||
cprintf("\n");
|
||||
*/
|
||||
memmove(dst, bp->data + off%BSIZE, m);
|
||||
brelse(bp);
|
||||
}
|
||||
|
@ -617,7 +610,7 @@ namex(char *path, int nameiparent, char *name)
|
|||
if(*path == '/')
|
||||
ip = iget(ROOTDEV, ROOTINO);
|
||||
else
|
||||
ip = idup(proc->cwd);
|
||||
ip = idup(myproc()->cwd);
|
||||
|
||||
while((path = skipelem(path, name)) != 0){
|
||||
ilock(ip);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue