From d2939161c783c8394ac995d44995fb028731ac28 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 5 Aug 2019 23:10:03 +0200 Subject: 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 --- include/squashfs.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') 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; -- cgit v1.2.3