The Peanut filesystem divides the total space into blocks. It distinguishes between unallocated blocks, data blocks and blocks containing node informations. Each allocated data block is associated to a node block. Unallocated blocks are collected in a linked list.
Peanut knows two types of nodes, file nodes and directory nodes. Each file node represents a file entry and the associated data blocks contain the contents of this file. Each directory node represents a directory and the associated data blocks contain the entries in this directory. Each directory entry in use contains a link to to a node block.
Data Fields | |
u_char | node_type |
u_char | node_refs |
u_short | node_links |
Number of links. | |
u_long | node_size |
time_t | node_mtime |
PNUT_BLKNUM | node_blocks [PNUT_BLOCKS_PER_NODE] |
|
Type of this node, 0=file, 1=dir |
|
Reference counter: Number of active open calls. |
|
Number of links. For file nodes this number keeps track of the number of directory entries pointing to it. PNUT currently doesn't support link type entries, thus in file entries this is always 1. For directory nodes the number represents the number of subdirectories plus 2. |
|
Total size of the data area. |
|
Time of last modification. |
|
Allocated data blocks. |