diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-05-23 17:21:24 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-05-23 17:30:29 +0200 |
commit | d9e5895829a2c20e7624326ce391f0e56762b855 (patch) | |
tree | c7ba4fa9322d5038da8e53aef200a47d01558604 /lib/sqfs/block_processor/internal.h | |
parent | 4587a56466f0c55d91ece168f0dc872f81a8196c (diff) |
block processor: move the block consolidation to the worker thread
Instead of merging fragments into the fragment block inside the
process_completed_fragment function, store a linked list of fragments
in the fragment block and do the actual merging (several memcpy calls
totaling of up to 1M of data in worst case) in the worker thread
instead of the locked, serial path.
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.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sqfs/block_processor/internal.h b/lib/sqfs/block_processor/internal.h index eff5374..775671c 100644 --- a/lib/sqfs/block_processor/internal.h +++ b/lib/sqfs/block_processor/internal.h @@ -22,6 +22,7 @@ #include <string.h> #include <stdlib.h> +#include <assert.h> typedef struct sqfs_block_t { struct sqfs_block_t *next; @@ -33,9 +34,14 @@ typedef struct sqfs_block_t { sqfs_u32 size; sqfs_u32 checksum; - /* Data block index within the inode or fragment block index. */ + /* For data blocks: index within the inode. + For fragment fragment blocks: fragment table index. */ sqfs_u32 index; + /* For fragment blocks: list of fragments to + consolidate in reverse order. */ + struct sqfs_block_t *frag_list; + sqfs_u8 data[]; } sqfs_block_t; |