summaryrefslogtreecommitdiff
path: root/lib/sqfs/blk_proc/process_block.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-25 06:03:36 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-25 06:35:01 +0200
commit3da78a56df43360520f8007bdb4e11fa25f712cc (patch)
treef1dfd2ca166909ac3a9c37d8ec5196b11a548bb0 /lib/sqfs/blk_proc/process_block.c
parentb6400d20cc64afff22d2805c58dc04f2234d38a5 (diff)
Refactor out common code of the block processors
Code that already is shared between the pthread and the serial processor as well as code that can be re-used by other threading API implementations. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/blk_proc/process_block.c')
-rw-r--r--lib/sqfs/blk_proc/process_block.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/sqfs/blk_proc/process_block.c b/lib/sqfs/blk_proc/process_block.c
index f154a14..2951406 100644
--- a/lib/sqfs/blk_proc/process_block.c
+++ b/lib/sqfs/blk_proc/process_block.c
@@ -9,37 +9,6 @@
#include <string.h>
-int sqfs_block_process(sqfs_block_t *block, sqfs_compressor_t *cmp,
- uint8_t *scratch, size_t scratch_size)
-{
- ssize_t ret;
-
- if (block->size == 0) {
- block->checksum = 0;
- return 0;
- }
-
- block->checksum = crc32(0, block->data, block->size);
-
- if (block->flags & SQFS_BLK_IS_FRAGMENT)
- return 0;
-
- if (!(block->flags & SQFS_BLK_DONT_COMPRESS)) {
- ret = cmp->do_block(cmp, block->data, block->size,
- scratch, scratch_size);
- if (ret < 0)
- return ret;
-
- if (ret > 0) {
- memcpy(block->data, scratch, ret);
- block->size = ret;
- block->flags |= SQFS_BLK_IS_COMPRESSED;
- }
- }
-
- return 0;
-}
-
static int allign_file(sqfs_block_processor_t *proc, sqfs_block_t *blk)
{
if (!(blk->flags & SQFS_BLK_ALLIGN))