TARFS 0.1.5
Read-only TAR filesystem for ESP32
Loading...
Searching...
No Matches
tarfs_inode_t Struct Reference

TARFS inode structure, 12..20 bytes per inode; 1000 files require ~16KiB of RAM to store the filesystem index. More...

#include <inode.h>

Data Fields

uint32_t in_hash
uintptr_t in_path
uintptr_t in_vaddr
uintptr_t in_dvaddr
struct tarfs_inode * in_next

Detailed Description

TARFS inode structure, 12..20 bytes per inode; 1000 files require ~16KiB of RAM to store the filesystem index.

Inode represents a resolved filesystem object as a mapping: (hashed pathname) -> (tar header location in archive memory).

Each inode corresponds to one usable tar entry.

Usable entries are tar record types:

  • 0 : regular file
  • 1 : hard link
  • 2 : symbolic link
  • 5 : directory

Notes:

  • inode resolution always follows link targets until a final FILE (0) or DIRECTORY (5) entry is reached.

A structure like this: name1 -links--> name2 –link--> name4.txt will result in 3 inodes:

inode1.in_vaddr ==> "name1" entry inode1.in_dvaddr ==> "name4.txt" entry

inode2.in_vaddr ==> "name2" entry inode2.in_dvaddr ==> "name4.txt" entry

inode3.in_vaddr ==> "name4.txt" entry inode3.in_dvaddr ==> "name4.txt" entry

TARFS maintains two independent indexes:

  • inode_index[] : sorted by in_hash for O(log N) pathname lookup.
  • in_next : linked list sorted by pathname for directory enumeration and prefix scans.

Definition at line 63 of file inode.h.

Field Documentation

◆ in_dvaddr

uintptr_t tarfs_inode_t::in_dvaddr

final resolved target after link resolution, i.e. a file or a directory

Definition at line 68 of file inode.h.

◆ in_hash

uint32_t tarfs_inode_t::in_hash

Hash of full path of the entry

Definition at line 65 of file inode.h.

◆ in_next

struct tarfs_inode* tarfs_inode_t::in_next

Next inode in lexicographical pathname order. The original inode array is never reordered. Sorting is achieved solely by relinking inodes through this field.

Definition at line 69 of file inode.h.

◆ in_path

uintptr_t tarfs_inode_t::in_path

Pointer to the full pathname. The pathname is not guaranteed to be NUL-terminated. It may end at '\0', '\r' or '
', therefore tar_strcmp() must be used.

Definition at line 66 of file inode.h.

◆ in_vaddr

uintptr_t tarfs_inode_t::in_vaddr

Virtual address of the original tarhdr entry

Definition at line 67 of file inode.h.


The documentation for this struct was generated from the following file:
  • /cygdrive/d/Arduino/libraries/tarfs/src/inode.h