aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/common.h2
-rw-r--r--include/sqfs/block_processor.h23
2 files changed, 14 insertions, 11 deletions
diff --git a/include/common.h b/include/common.h
index 0fd349a..cf2d1b5 100644
--- a/include/common.h
+++ b/include/common.h
@@ -116,7 +116,7 @@ sqfs_file_t *sqfs_get_stdin_file(FILE *fp, const sparse_map_t *map,
sqfs_u64 size);
int write_data_from_file(const char *filename, sqfs_block_processor_t *data,
- sqfs_inode_generic_t *inode,
+ sqfs_inode_generic_t **inode,
sqfs_file_t *file, int flags);
void sqfs_writer_cfg_init(sqfs_writer_cfg_t *cfg);
diff --git a/include/sqfs/block_processor.h b/include/sqfs/block_processor.h
index 6945633..2ad12c0 100644
--- a/include/sqfs/block_processor.h
+++ b/include/sqfs/block_processor.h
@@ -142,24 +142,27 @@ sqfs_block_processor_t *sqfs_block_processor_create(size_t max_block_size,
* are done. After writing all files, use @ref sqfs_block_processor_finish to
* wait until all blocks that are still in flight are done and written to disk.
*
- * The specified inode pointer is kept internally and updated with the
- * compressed block sizes and final destinations of the file and possible
- * fragment. You need to make sure it has enough backing-store for all blocks
- * to come. Furthermore, since there can still be blocks in-flight even after
- * calling @ref sqfs_block_processor_end_file, the data in the inode may still
- * change. The only point at which the data writer is guarnteed to not touch
- * them anymore is after @ref sqfs_block_processor_finish has returned.
+ * The specified pointer to an inode pointer is kept internally and updated with
+ * the compressed block sizes and final destinations of the file and possible
+ * fragment. Since the inode may have to be grown to larger size, the actual
+ * inode pointer can change over time. Furthermore, since there can still be
+ * blocks in-flight even after calling @ref sqfs_block_processor_end_file, the
+ * data in the inode and the value of the pointer may still change. The only
+ * point at which the data writer is guaranteed to not touch them anymore is
+ * after @ref sqfs_block_processor_sync or @ref sqfs_block_processor_finish has
+ * returned.
*
* @param proc A pointer to a data writer object.
- * @param inode The regular file inode representing the file. The data writer
- * internally updates it while writing blocks to disk.
+ * @param inode A pointer to a pointer to an inode. The block processor creates
+ * a file inode and stores a pointer to it here and keeps updating
+ * the inode as the file grows.
* @param flags A combination of @ref E_SQFS_BLK_FLAGS that can be used to
* micro manage how the data is processed.
*
* @return Zero on success, an @ref E_SQFS_ERROR value on failure.
*/
SQFS_API int sqfs_block_processor_begin_file(sqfs_block_processor_t *proc,
- sqfs_inode_generic_t *inode,
+ sqfs_inode_generic_t **inode,
sqfs_u32 flags);
/**