summaryrefslogtreecommitdiff
path: root/include/highlevel.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-26 14:33:55 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-26 15:32:38 +0200
commit248765bd9f6ead4fbe4e5822bcaf46b85fe1687f (patch)
tree1e487925a3bb4011ea1c355bce77413657e79b06 /include/highlevel.h
parent2341da0e0654aa8e89e5f3630f8142346788e061 (diff)
Remove remnants of the old data writer
- Move the statstics hooks to the rest of the statistics code - Used the new data writer directly in gensquashfs & tar2sqfs - Demote what is left to a helper function for processing an input file and submitting it to the new data writer Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/highlevel.h')
-rw-r--r--include/highlevel.h36
1 files changed, 34 insertions, 2 deletions
diff --git a/include/highlevel.h b/include/highlevel.h
index bfc2d91..5bc4a96 100644
--- a/include/highlevel.h
+++ b/include/highlevel.h
@@ -15,20 +15,47 @@
#include "sqfs/data.h"
#include "sqfs/table.h"
#include "sqfs/meta_writer.h"
+#include "sqfs/data_reader.h"
+#include "sqfs/data_writer.h"
#include "sqfs/dir_writer.h"
#include "sqfs/dir_reader.h"
+#include "sqfs/block.h"
#include "sqfs/xattr.h"
#include "sqfs/dir.h"
#include "sqfs/io.h"
-#include "sqfs/data_reader.h"
-#include "data_writer.h"
#include "fstree.h"
+#include "util.h"
#include "tar.h"
#include <sys/stat.h>
#include <stdint.h>
#include <stddef.h>
+typedef struct {
+ size_t file_count;
+ size_t blocks_written;
+ size_t frag_blocks_written;
+ size_t duplicate_blocks;
+ size_t sparse_blocks;
+ size_t frag_count;
+ size_t frag_dup;
+ uint64_t bytes_written;
+ uint64_t bytes_read;
+} data_writer_stats_t;
+
+enum {
+ /* Don't generate fragments, always write the last block to disk as a
+ block, even if it is incomplete. */
+ DW_DONT_FRAGMENT = 0x01,
+
+ /* Intentionally write all blocks uncompressed. */
+ DW_DONT_COMPRESS = 0x02,
+
+ /* Make sure the first block of a file is alligned to
+ device block size */
+ DW_ALLIGN_DEVBLK = 0x04,
+};
+
/*
High level helper function to serialize an entire file system tree to
a squashfs inode table and directory table.
@@ -86,4 +113,9 @@ int sqfs_data_reader_dump(sqfs_data_reader_t *data,
sqfs_file_t *sqfs_get_stdin_file(const sparse_map_t *map, uint64_t size);
+void register_stat_hooks(sqfs_data_writer_t *data, data_writer_stats_t *stats);
+
+int write_data_from_file(sqfs_data_writer_t *data, sqfs_inode_generic_t *inode,
+ sqfs_file_t *file, size_t block_size, int flags);
+
#endif /* HIGHLEVEL_H */