summaryrefslogtreecommitdiff
path: root/lib/sqfs/blk_proc/process_block.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-24 01:55:08 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-24 01:55:08 +0200
commit87d577a66eb3b1aaca91c4841445cccaf151ee81 (patch)
treea18d674c9949bc75db584218ab2fa227a2f2b752 /lib/sqfs/blk_proc/process_block.c
parent824423a9d2395514101cb837c2ede5473cf106ce (diff)
Process completed blocks one-by-one
This commit makes sure the block processor enqueue function dequeues at most a single block which it dispatches. 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.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/lib/sqfs/blk_proc/process_block.c b/lib/sqfs/blk_proc/process_block.c
index 643d964..b303278 100644
--- a/lib/sqfs/blk_proc/process_block.c
+++ b/lib/sqfs/blk_proc/process_block.c
@@ -105,7 +105,7 @@ static size_t grow_fragment_table(sqfs_block_processor_t *proc, size_t index)
return 0;
}
-static int handle_block(sqfs_block_processor_t *proc, sqfs_block_t *blk)
+int process_completed_block(sqfs_block_processor_t *proc, sqfs_block_t *blk)
{
size_t start, count;
uint64_t offset;
@@ -181,28 +181,3 @@ static int handle_block(sqfs_block_processor_t *proc, sqfs_block_t *blk)
return 0;
}
-
-int process_completed_blocks(sqfs_block_processor_t *proc, sqfs_block_t *queue)
-{
- sqfs_block_t *it;
- int err;
-
- while (queue != NULL) {
- it = queue;
- queue = queue->next;
-
- err = handle_block(proc, it);
- free(it);
-
- if (err) {
- while (queue != NULL) {
- it = queue;
- queue = it->next;
- free(it);
- }
- return err;
- }
- }
-
- return 0;
-}