NASD Programmer's Documentation
Inodes

The drive filesystem uses inodes to represent objects. Each inode is uniquely identified by an inode number (type nasd_nodenum_t). This value is used to form the low 32 bits of each NASD identifier (nasd_identifier_t). The inode number forms an index into the inode hash table (also variously referred to as the inode page table or the node page table (npt)). At this time, each inode occupies an entire logical block on the NASD.

Each block in the inode hash table contains NASD_OD_NODES_PER_NPT_BLOCK entries of type nasd_od_pte_t. The blkno field of this entry is the block number occupied by the inode. The highbits field is the high 32 bits of the NASD identifier for this object. Because whomever is parsing this block knows which block they are reading, and what slot they are examining, the low 32 bits of the NASD identifier can be trivially calculated. Bits 53-56 of the NASD identifier are the partition number the object occupies. This allows a list of objects in a partition to be generated without reading the inodes themselves.

The inode contains all non-pointer metadata related to an object. Additionally, it contains many pointers to direct and indirect blocks. The parameterization of the number of levels of direct and indirect pointers (NASD_OD_ILVLS), and the number of pointers at each level, is contained in nasd_od.h. These definitions are generated by blockparam, which is built in the drive/ subdirectory.

At the moment, copy-on-write of inodes is not implemented. Therefore, COW fields are largely ignored by the code.

In addition to pointers to direct and indirect blocks, the inode contains a pointer to a single range of blocks, prealloc_ex. If the first and last fields of prealloc_ex are NASD_NULL_BLKNO, there is no preallocated range bound to the object. If they are valued otherwise, then prealloc_ex is a contiguous range of blocks set aside for the use of this object by the layout policy.

Further information about parsing direct and indirect block pointers may be found in mapping.


<--- ---> ^<br>|<br>|
Drive types In-core extents NASD Programmer's Documentation