Nut/OS  4.10.3
API Reference
PNUT_NODE Struct Reference

Node structure. More...

Collaboration diagram for PNUT_NODE:

Data Fields

uint8_t node_type
uint8_t node_refs
uint16_t node_links
 Number of links.
uint32_t node_size
time_t node_mtime
PNUT_BLKNUM node_blocks [PNUT_BLOCKS_PER_NODE]

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.

Definition at line 205 of file pnutfs.c.


Field Documentation

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

Definition at line 206 of file pnutfs.c.

Reference counter: Number of active open calls.

Definition at line 207 of file pnutfs.c.

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.

Definition at line 218 of file pnutfs.c.

Total size of the data area.

Definition at line 219 of file pnutfs.c.

Time of last modification.

Definition at line 220 of file pnutfs.c.

PNUT_BLKNUM PNUT_NODE::node_blocks[PNUT_BLOCKS_PER_NODE]

Allocated data blocks.

Definition at line 221 of file pnutfs.c.


The documentation for this struct was generated from the following file: