From 2ce40d7088932b2875739379f54f7d74fc2e374c Mon Sep 17 00:00:00 2001
From: rtm <rtm>
Date: Wed, 8 Oct 2008 18:57:13 +0000
Subject: [PATCH] be clear what the root i-number is

---
 fs.c   | 2 +-
 fs.h   | 1 +
 mkfs.c | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs.c b/fs.c
index 24f6f75..63e3e40 100644
--- a/fs.c
+++ b/fs.c
@@ -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);
 
diff --git a/fs.h b/fs.h
index e1cc7a2..a7d93b4 100644
--- a/fs.h
+++ b/fs.h
@@ -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
diff --git a/mkfs.c b/mkfs.c
index 4614f99..3046f9b 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -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);
-- 
GitLab