be clear what the root i-number is
This commit is contained in:
parent
be38c8413e
commit
2ce40d7088
2
fs.c
2
fs.c
|
@ -582,7 +582,7 @@ _namei(char *path, int parent, char *name)
|
||||||
struct inode *ip, *next;
|
struct inode *ip, *next;
|
||||||
|
|
||||||
if(*path == '/')
|
if(*path == '/')
|
||||||
ip = iget(ROOTDEV, 1);
|
ip = iget(ROOTDEV, ROOTINO);
|
||||||
else
|
else
|
||||||
ip = idup(cp->cwd);
|
ip = idup(cp->cwd);
|
||||||
|
|
||||||
|
|
1
fs.h
1
fs.h
|
@ -5,6 +5,7 @@
|
||||||
// Block 1 is super block.
|
// Block 1 is super block.
|
||||||
// Inodes start at block 2.
|
// Inodes start at block 2.
|
||||||
|
|
||||||
|
#define ROOTINO 1 // root i-number
|
||||||
#define BSIZE 512 // block size
|
#define BSIZE 512 // block size
|
||||||
|
|
||||||
// File system super block
|
// File system super block
|
||||||
|
|
Loading…
Reference in a new issue