32#define SQFS_MAGIC 0x73717368
33#define SQFS_VERSION_MAJOR 4
34#define SQFS_VERSION_MINOR 0
35#define SQFS_DEVBLK_SIZE 4096
37#define SQFS_MIN_BLOCK_SIZE (4 * 1024)
38#define SQFS_MAX_BLOCK_SIZE (1024 * 1024)
39#define SQFS_DEFAULT_BLOCK_SIZE (128 * 1024)
Includes forward declarations of data structures, macros and integer types.
Abstracts file I/O to make it easy to embedd SquashFS.
The SquashFS super block, located at the beginning of the file system to describe the layout of the f...
sqfs_u32 inode_count
Total number of inodes.
sqfs_u16 id_count
The total number of unique user or group IDs.
sqfs_u16 version_major
Must be SQFS_VERSION_MAJOR.
sqfs_u64 id_table_start
On-disk location of the ID table.
sqfs_u32 magic
Magic number. Must be set to SQFS_MAGIC.
sqfs_u16 block_log
The log2 of the block_size field for sanity checking.
sqfs_u64 directory_table_start
On-disk location of the first meta data block containing the directory entries.
sqfs_u32 fragment_entry_count
The number of fragment blocks in the data area.
sqfs_u64 bytes_used
Total size of the file system in bytes, not counting padding.
sqfs_u16 version_minor
Must be SQFS_VERSION_MINOR.
SQFS_API int sqfs_super_write(const sqfs_super_t *super, sqfs_file_t *file)
Encode and write a SquashFS super block to disk.
sqfs_u32 modification_time
Last time the filesystem was modified.
sqfs_u16 flags
A combination of SQFS_SUPER_FLAGS flags.
sqfs_u64 xattr_id_table_start
On-disk location of the extended attribute table (if present)
sqfs_u64 export_table_start
On-disk location of the export table (if present)
sqfs_u64 fragment_table_start
On-disk location of the fragment table (if present)
SQFS_API int sqfs_super_read(sqfs_super_t *super, sqfs_file_t *file)
Read a SquashFS super block from disk, decode it and check the fields.
sqfs_u64 inode_table_start
On-disk location of the first meta data block containing the inodes.
sqfs_u16 compression_id
Identifies the compressor that has been used.
sqfs_u32 block_size
The data block size in bytes.
SQFS_API int sqfs_super_init(sqfs_super_t *super, size_t block_size, sqfs_u32 mtime, SQFS_COMPRESSOR compressor)
Initialize the SquashFS super block.
sqfs_u64 root_inode_ref
A reference to the root inode.
SQFS_SUPER_FLAGS
Flags that can be set in sqfs_super flags field.
@ SQFS_FLAG_UNCOMPRESSED_IDS
Set to indicate that meta data blocks holding the IDs are stored uncompressed.
@ SQFS_FLAG_UNCOMPRESSED_DATA
Set to indicate that all data blocks are stored uncompressed.
@ SQFS_FLAG_NO_FRAGMENTS
Set to indicate that there are no fragment blocks.
@ SQFS_FLAG_UNCOMPRESSED_XATTRS
Set to indicate that meta data blocks holding extended attributes are stored uncompressed.
@ SQFS_FLAG_COMPRESSOR_OPTIONS
Set to indicate that a single, uncompressed meta data block with compressor options follows the super...
@ SQFS_FLAG_EXPORTABLE
Set to indicate that an NFS export table is present.
@ SQFS_FLAG_UNCOMPRESSED_FRAGMENTS
Set to indicate that all fragment blocks are stored uncompressed.
@ SQFS_FLAG_NO_XATTRS
Set to indicate that the filesystem does not contain extended attributes.
@ SQFS_FLAG_UNCOMPRESSED_INODES
Set to indicate that meta data blocks holding the inodes are stored uncompressed.
@ SQFS_FLAG_ALWAYS_FRAGMENTS
Set to indicate that fragments have been generated for all files that are not a multiple of the block...
@ SQFS_FLAG_NO_DUPLICATES
Set to indicate that data blocks have not been deduplicated.
SQFS_COMPRESSOR
Set in sqfs_super_t to identify the compresser used by the filesystem.