aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs/block_processor/frontend.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-05-29 20:08:33 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-05-29 20:10:16 +0200
commitefb6ab552c5cdc9d12585c7c24b98667e212cb4c (patch)
treeab3ea9e3a22d8e4111cbc7b99ee99c6b6dae32f9 /lib/sqfs/block_processor/frontend.c
parentbe6c0820313401f92f272db96f66053bdaa15320 (diff)
Block processor: merge finish & sync functions
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/block_processor/frontend.c')
-rw-r--r--lib/sqfs/block_processor/frontend.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/sqfs/block_processor/frontend.c b/lib/sqfs/block_processor/frontend.c
index 9e9ecc7..daf12e7 100644
--- a/lib/sqfs/block_processor/frontend.c
+++ b/lib/sqfs/block_processor/frontend.c
@@ -197,6 +197,33 @@ int sqfs_block_processor_submit_block(sqfs_block_processor_t *proc, void *user,
return proc->append_to_work_queue(proc, blk);
}
+int sqfs_block_processor_sync(sqfs_block_processor_t *proc)
+{
+ return proc->sync(proc);
+}
+
+int sqfs_block_processor_finish(sqfs_block_processor_t *proc)
+{
+ sqfs_block_t *blk;
+ int status;
+
+ status = proc->sync(proc);
+
+ if (status == 0 && proc->frag_block != NULL) {
+ blk = proc->frag_block;
+ blk->next = NULL;
+ blk->flags |= BLK_FLAG_MANUAL_SUBMISSION;
+ proc->frag_block = NULL;
+
+ status = proc->append_to_work_queue(proc, blk);
+
+ if (status == 0)
+ status = proc->sync(proc);
+ }
+
+ return status;
+}
+
const sqfs_block_processor_stats_t
*sqfs_block_processor_get_stats(const sqfs_block_processor_t *proc)
{