inode 1

Guy Harris guy at auspex.auspex.com
Wed Jan 30 05:44:10 AEST 1991


>Not knowing a lot about the implementation of inodes, I can only guess as to
>why inode 1 is empty and unnamed.  Sometimes, when people implement a linked 
>list or other related data types, they have a dummy header node to the list.
>What this does is eliminate the need of handling certain special cases when
>adding or deleting to or from the front of the list, which produces more 
>easily readable source code.  The overhead of one additional node is 
>negligible.  Maybe that's why the first inode is unamed and empty...

Nope.  This was discussed recently in "comp.unix", I think.  In V7, the
root inode was moved from inode 1 to inode 2; the intent was apparently
to have inode 1 be the "bad block file", to which all disk blocks
unusable due to medium errors would be assigned.  "mkfs" had a
half-implemented mechanism to do this; it would call a routine to ask if
a block is bad and, if so, assign that block to inode 1 - but the
routine never said the block was bad.  Some, perhaps all, utilities that
scanned the ilist would skip inode 1 for certain purposes.

The ilist wasn't a linked list in V7, so the dummy header node idea
doesn't apply.



More information about the Comp.unix.wizards mailing list