be clear what the root i-number is

This commit is contained in:
rtm 2008-10-08 18:57:13 +00:00
parent be38c8413e
commit 2ce40d7088
3 changed files with 3 additions and 2 deletions

2
fs.c
View file

@ -582,7 +582,7 @@ _namei(char *path, int parent, char *name)
struct inode *ip, *next;
if(*path == '/')
ip = iget(ROOTDEV, 1);
ip = iget(ROOTDEV, ROOTINO);
else
ip = idup(cp->cwd);

1
fs.h
View file

@ -5,6 +5,7 @@
// Block 1 is super block.
// Inodes start at block 2.
#define ROOTINO 1 // root i-number
#define BSIZE 512 // block size
// File system super block

2
mkfs.c
View file

@ -92,7 +92,7 @@ main(int argc, char *argv[])
wsect(1, &sb);
rootino = ialloc(T_DIR);
assert(rootino == 1);
assert(rootino == ROOTINO);
bzero(&de, sizeof(de));
de.inum = xshort(rootino);