libsquashfs 1.3.0
A new set of tools and libraries for working with SquashFS images
|
A simple data structure that encapsulates ID to index mapping for user and group IDs. More...
#include <id_table.h>
Public Member Functions | |
SQFS_API sqfs_id_table_t * | sqfs_id_table_create (sqfs_u32 flags) |
Create an ID table object. | |
SQFS_API int | sqfs_id_table_id_to_index (sqfs_id_table_t *tbl, sqfs_u32 id, sqfs_u16 *out) |
Resolve a 32 bit ID to a unique 16 bit index. | |
SQFS_API int | sqfs_id_table_write (sqfs_id_table_t *tbl, sqfs_file_t *file, sqfs_super_t *super, sqfs_compressor_t *cmp) |
Write an ID table to disk. | |
SQFS_API int | sqfs_id_table_read (sqfs_id_table_t *tbl, sqfs_file_t *file, const sqfs_super_t *super, sqfs_compressor_t *cmp) |
Read an ID table from disk. | |
SQFS_API int | sqfs_id_table_index_to_id (const sqfs_id_table_t *tbl, sqfs_u16 index, sqfs_u32 *out) |
Resolve a 16 bit index to a 32 bit ID. | |
Additional Inherited Members | |
Static Public Member Functions inherited from sqfs_object_t | |
static SQFS_INLINE void | sqfs_destroy (void *obj) |
Destroy an object and free all its memory. | |
static SQFS_INLINE void * | sqfs_copy (const void *obj) |
Create a deep copy of an object if possible. | |
Data Fields inherited from sqfs_object_t | |
void(* | destroy )(struct sqfs_object_t *instance) |
struct sqfs_object_t *(* | copy )(const struct sqfs_object_t *orig) |
A simple data structure that encapsulates ID to index mapping for user and group IDs.
SquashFS does not store user and group IDs in inodes directly. Instead, it collects the unique 32 bit IDs in a table with at most 64k entries and stores a 16 bit index into the inode. This allows SquashFS to only have 16 bit UID/GID entries in the inodes but actually have 32 bit UIDs/GIDs under the hood (at least 64k selected ones).
SQFS_API sqfs_id_table_t * sqfs_id_table_create | ( | sqfs_u32 | flags | ) |
Create an ID table object.
flags | Currently must be set to 0 or creating the table fails. |
SQFS_API int sqfs_id_table_id_to_index | ( | sqfs_id_table_t * | tbl, |
sqfs_u32 | id, | ||
sqfs_u16 * | out | ||
) |
Resolve a 32 bit ID to a unique 16 bit index.
tbl | A pointer to an ID table object. |
id | The ID to resolve. |
out | Returns the unique table index. |
SQFS_API int sqfs_id_table_index_to_id | ( | const sqfs_id_table_t * | tbl, |
sqfs_u16 | index, | ||
sqfs_u32 * | out | ||
) |
Resolve a 16 bit index to a 32 bit ID.
tbl | A pointer to an ID table object. |
index | The table index to resolve. |
out | Returns the underlying 32 bit ID that the index maps to. |
SQFS_API int sqfs_id_table_read | ( | sqfs_id_table_t * | tbl, |
sqfs_file_t * | file, | ||
const sqfs_super_t * | super, | ||
sqfs_compressor_t * | cmp | ||
) |
Read an ID table from disk.
tbl | A pointer to an ID table object. |
file | The underlying file to read the table from. |
super | A pointer to a super block from which to get the ID table location. |
cmp | A compressor to use to extract compressed table blocks. |
SQFS_API int sqfs_id_table_write | ( | sqfs_id_table_t * | tbl, |
sqfs_file_t * | file, | ||
sqfs_super_t * | super, | ||
sqfs_compressor_t * | cmp | ||
) |
Write an ID table to disk.
tbl | A pointer to an ID table object. |
file | The underlying file to append the table to. |
super | A pointer to a super block in which to store the ID table start location. |
cmp | A compressor to use to compress the ID table. |