summaryrefslogtreecommitdiff
path: root/lib/sqfs/block_processor/internal.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-01-31 17:15:04 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-01-31 17:15:04 +0100
commit940c3e3333ba0063f536dfbecbb77d070dbcc87a (patch)
tree89c7f7159d5d6b597453c4df38752647af7146e0 /lib/sqfs/block_processor/internal.h
parent9d5b0c381a7961a14d2a94a6b31a4e25a2543eae (diff)
Split the block writing/deduplication away from the block processor
This commit moves the entire block writing and deduplication of data blocks over to a different data type named "block writer". For simplicity, the interfaces of the block processor are left as is and are turned into warppers. Likewise, most of the code in the block writer is just verbatim from the block processor, to be cleaned up in subsequent commits. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/block_processor/internal.h')
-rw-r--r--lib/sqfs/block_processor/internal.h24
1 files changed, 3 insertions, 21 deletions
diff --git a/lib/sqfs/block_processor/internal.h b/lib/sqfs/block_processor/internal.h
index 40871b9..16f0edb 100644
--- a/lib/sqfs/block_processor/internal.h
+++ b/lib/sqfs/block_processor/internal.h
@@ -10,6 +10,7 @@
#include "config.h"
#include "sqfs/block_processor.h"
+#include "sqfs/block_writer.h"
#include "sqfs/frag_table.h"
#include "sqfs/compressor.h"
#include "sqfs/inode.h"
@@ -31,19 +32,6 @@
#include <windows.h>
#endif
-
-#define MK_BLK_HASH(chksum, size) \
- (((sqfs_u64)(size) << 32) | (sqfs_u64)(chksum))
-
-#define INIT_BLOCK_COUNT (128)
-
-
-typedef struct {
- sqfs_u64 offset;
- sqfs_u64 hash;
-} blk_info_t;
-
-
typedef struct compress_worker_t compress_worker_t;
struct sqfs_block_processor_t {
@@ -73,24 +61,18 @@ struct sqfs_block_processor_t {
unsigned int num_workers;
size_t max_backlog;
- size_t devblksz;
sqfs_file_t *file;
sqfs_frag_table_t *frag_tbl;
- sqfs_u64 start;
-
- size_t file_start;
- size_t num_blocks;
- size_t max_blocks;
- blk_info_t *blocks;
sqfs_compressor_t *cmp;
sqfs_block_t *frag_block;
+ bool notify_threads;
+ sqfs_block_writer_t *wr;
const sqfs_block_hooks_t *hooks;
void *user_ptr;
- bool notify_threads;
/* file API */
sqfs_inode_generic_t *inode;