summaryrefslogtreecommitdiff
path: root/lib/sqfs/data_writer/serial.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-01-28 21:23:21 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-01-29 17:22:50 +0100
commit9d5b0c381a7961a14d2a94a6b31a4e25a2543eae (patch)
tree089a3cc96f54cd7b09762840d03e4dc2420c5ea9 /lib/sqfs/data_writer/serial.c
parent60ff56b68ea0593782d7a2ef0ac4e667437418d2 (diff)
Rename sqfs_data_writer_t back to sqfs_block_processor_t
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/data_writer/serial.c')
-rw-r--r--lib/sqfs/data_writer/serial.c88
1 files changed, 0 insertions, 88 deletions
diff --git a/lib/sqfs/data_writer/serial.c b/lib/sqfs/data_writer/serial.c
deleted file mode 100644
index 82f7836..0000000
--- a/lib/sqfs/data_writer/serial.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* SPDX-License-Identifier: LGPL-3.0-or-later */
-/*
- * serial.c
- *
- * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
- */
-#define SQFS_BUILDING_DLL
-#include "internal.h"
-
-sqfs_data_writer_t *sqfs_data_writer_create(size_t max_block_size,
- sqfs_compressor_t *cmp,
- unsigned int num_workers,
- size_t max_backlog,
- size_t devblksz,
- sqfs_file_t *file)
-{
- sqfs_data_writer_t *proc;
-
- proc = alloc_flex(sizeof(*proc), 1, max_block_size);
-
- if (proc == NULL)
- return NULL;
-
- if (data_writer_init(proc, max_block_size, cmp, num_workers,
- max_backlog, devblksz, file)) {
- data_writer_cleanup(proc);
- return NULL;
- }
-
- return proc;
-}
-
-void sqfs_data_writer_destroy(sqfs_data_writer_t *proc)
-{
- data_writer_cleanup(proc);
-}
-
-int test_and_set_status(sqfs_data_writer_t *proc, int status)
-{
- if (proc->status == 0)
- proc->status = status;
-
- return proc->status;
-}
-
-int append_to_work_queue(sqfs_data_writer_t *proc, sqfs_block_t *block,
- bool signal_threads)
-{
- sqfs_block_t *fragblk = NULL;
- (void)signal_threads;
-
- if (proc->status != 0 || block == NULL) {
- free(block);
- return proc->status;
- }
-
- if (block->flags & SQFS_BLK_IS_FRAGMENT) {
- block->checksum = crc32(0, block->data, block->size);
-
- proc->status = process_completed_fragment(proc, block,
- &fragblk);
- free(block);
-
- if (proc->status != 0) {
- free(fragblk);
- return proc->status;
- }
-
- if (fragblk == NULL)
- return 0;
-
- block = fragblk;
- }
-
- proc->status = data_writer_do_block(block, proc->cmp, proc->scratch,
- proc->max_block_size);
-
- if (proc->status == 0)
- proc->status = process_completed_block(proc, block);
-
- free(block);
- return proc->status;
-}
-
-int wait_completed(sqfs_data_writer_t *proc)
-{
- return proc->status;
-}