Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

PNUT_NODE Struct Reference
[Peanut File System]


Detailed Description

Node structure.

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.

Note:
The node structure must fit into a 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]


Field Documentation

u_char PNUT_NODE::node_type
 

Type of this node, 0=file, 1=dir

u_char PNUT_NODE::node_refs
 

Reference counter: Number of active open calls.

u_short PNUT_NODE::node_links
 

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.

u_long PNUT_NODE::node_size
 

Total size of the data area.

time_t PNUT_NODE::node_mtime
 

Time of last modification.

PNUT_BLKNUM PNUT_NODE::node_blocks[PNUT_BLOCKS_PER_NODE]
 

Allocated data blocks.


© 2000-2006 by egnite Software GmbH - visit http://www.ethernut.de/