summaryrefslogtreecommitdiff
path: root/lib/sqfs/block_processor/fileapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqfs/block_processor/fileapi.c')
-rw-r--r--lib/sqfs/block_processor/fileapi.c45
1 files changed, 16 insertions, 29 deletions
diff --git a/lib/sqfs/block_processor/fileapi.c b/lib/sqfs/block_processor/fileapi.c
index 098f724..073d92f 100644
--- a/lib/sqfs/block_processor/fileapi.c
+++ b/lib/sqfs/block_processor/fileapi.c
@@ -7,19 +7,6 @@
#define SQFS_BUILDING_DLL
#include "internal.h"
-static int enqueue_block(sqfs_block_processor_t *proc, sqfs_block_t *block)
-{
- int status;
-
- while (proc->backlog > proc->max_backlog) {
- status = wait_completed(proc);
- if (status)
- return status;
- }
-
- return append_to_work_queue(proc, block);
-}
-
static int add_sentinel_block(sqfs_block_processor_t *proc)
{
sqfs_block_t *blk = calloc(1, sizeof(*blk));
@@ -30,21 +17,7 @@ static int add_sentinel_block(sqfs_block_processor_t *proc)
blk->inode = proc->inode;
blk->flags = proc->blk_flags | SQFS_BLK_LAST_BLOCK;
- return enqueue_block(proc, blk);
-}
-
-int sqfs_block_processor_begin_file(sqfs_block_processor_t *proc,
- sqfs_inode_generic_t *inode, sqfs_u32 flags)
-{
- if (proc->inode != NULL)
- return SQFS_ERROR_SEQUENCE;
-
- if (flags & ~SQFS_BLK_USER_SETTABLE_FLAGS)
- return SQFS_ERROR_UNSUPPORTED;
-
- proc->inode = inode;
- proc->blk_flags = flags | SQFS_BLK_FIRST_BLOCK;
- return 0;
+ return append_to_work_queue(proc, blk);
}
static int flush_block(sqfs_block_processor_t *proc)
@@ -60,7 +33,21 @@ static int flush_block(sqfs_block_processor_t *proc)
proc->blk_flags &= ~SQFS_BLK_FIRST_BLOCK;
}
- return enqueue_block(proc, block);
+ return append_to_work_queue(proc, block);
+}
+
+int sqfs_block_processor_begin_file(sqfs_block_processor_t *proc,
+ sqfs_inode_generic_t *inode, sqfs_u32 flags)
+{
+ if (proc->inode != NULL)
+ return SQFS_ERROR_SEQUENCE;
+
+ if (flags & ~SQFS_BLK_USER_SETTABLE_FLAGS)
+ return SQFS_ERROR_UNSUPPORTED;
+
+ proc->inode = inode;
+ proc->blk_flags = flags | SQFS_BLK_FIRST_BLOCK;
+ return 0;
}
int sqfs_block_processor_append(sqfs_block_processor_t *proc, const void *data,