diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-05 23:10:03 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-05 23:13:00 +0200 |
commit | d2939161c783c8394ac995d44995fb028731ac28 (patch) | |
tree | 726b9a52768b4e9e38bf7c2c78dbb28918fcc88c /include | |
parent | 88f75857702bcc6a2a423570912140c125ec518a (diff) |
cleanup data reader
- Split block reading code out from "dump_blocks" into precache_data_block,
similar to precache_fragment_block
- Merge the code paths for fragment/data block reading and uncompression
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r-- | include/squashfs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/squashfs.h b/include/squashfs.h index fb60049..eb35fdd 100644 --- a/include/squashfs.h +++ b/include/squashfs.h @@ -21,6 +21,10 @@ #define SQFS_DEVBLK_SIZE 4096 #define SQFS_MAX_DIR_ENT 256 +#define SQFS_IS_BLOCK_COMPRESSED(size) (((size) & (1 << 24)) == 0) +#define SQFS_ON_DISK_BLOCK_SIZE(size) ((size) & ((1 << 24) - 1)) +#define SQFS_IS_SPARSE_BLOCK(size) (SQFS_ON_DISK_BLOCK_SIZE(size) == 0) + typedef struct { uint32_t magic; uint32_t inode_count; |