libsquashfs: sqfs_inode_dir_t Struct Reference

libsquashfs 1.3.2 A new set of tools and libraries for working with SquashFS images

Loading...
Searching...
No Matches
sqfs_inode_dir_t Struct Reference

Follows a sqfs_inode_t if type is SQFS_INODE_DIR. More...

`#include <inode.h>`

Collaboration diagram for sqfs_inode_dir_t:

## Data Fields
sqfs_u32 | start_block
| Offset from the directory table start to the location of the meta data block containing the first directory header.
sqfs_u32 | nlink
| Number of hard links to this node.
sqfs_u16 | size
| Combined size of all directory entries and headers in bytes.
sqfs_u16 | offset
| Offset into the uncompressed start block where the header can be found.
sqfs_u32 | parent_inode
| Inode number of the parent directory containing this directory inode.

## Detailed Description

Follows a sqfs_inode_t if type is SQFS_INODE_DIR.

Definition at line 389 of file inode.h.

## Field Documentation

## ◆ nlink

sqfs_u32 nlink

Number of hard links to this node.

Definition at line 399 of file inode.h.

## ◆ offset

sqfs_u16 offset

Offset into the uncompressed start block where the header can be found.

Definition at line 419 of file inode.h.

## ◆ parent_inode

sqfs_u32 parent_inode

Inode number of the parent directory containing this directory inode.

Definition at line 425 of file inode.h.

## ◆ size

sqfs_u16 size

Combined size of all directory entries and headers in bytes.

The value stored here is off by 3 bytes, i.e. 3 bytes larger than the actual listing on disk. The Linux implementation of SquashFS uses readdir() offsets 0 and 1 to synthesize "." and ".." entries, and after that looks into the actual directory.

Why store an off-by-3 value on disk instead of faking it in the kernel and have something consistent here? Beats me, but that's how it is implemented.

Definition at line 413 of file inode.h.

## ◆ start_block

sqfs_u32 start_block

Offset from the directory table start to the location of the meta data block containing the first directory header.

Definition at line 394 of file inode.h.

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

- include/sqfs/inode.h