diff options
| author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-14 17:57:58 +0200 | 
|---|---|---|
| committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-14 18:06:04 +0200 | 
| commit | e165fb864fe86eda398a14713cf38924cc537adc (patch) | |
| tree | 217b80d56b1d8c21f3387390db06e525b2f9f064 /include | |
| parent | f57814332a69bebc40e25e6537a3c08fc9e18f97 (diff) | |
Remove fstree file flags
As a side effect, this requires the data writer to keep track of
statistics.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
| -rw-r--r-- | include/data_writer.h | 13 | ||||
| -rw-r--r-- | include/fstree.h | 11 | ||||
| -rw-r--r-- | include/highlevel.h | 6 | 
3 files changed, 16 insertions, 14 deletions
| diff --git a/include/data_writer.h b/include/data_writer.h index 9e82d11..5987cd6 100644 --- a/include/data_writer.h +++ b/include/data_writer.h @@ -16,6 +16,17 @@  typedef struct data_writer_t data_writer_t; +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_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. */ @@ -89,4 +100,6 @@ int write_data_from_fd(data_writer_t *data, file_info_t *fi, int infd,  int write_data_from_fd_condensed(data_writer_t *data, file_info_t *fi,  				 int infd, sparse_map_t *map, int flags); +data_writer_stats_t *data_writer_get_stats(data_writer_t *data); +  #endif /* DATA_WRITER_H */ diff --git a/include/fstree.h b/include/fstree.h index 8d0b952..4c02ce5 100644 --- a/include/fstree.h +++ b/include/fstree.h @@ -28,14 +28,6 @@ typedef struct fstree_t fstree_t;  typedef struct tree_xattr_t tree_xattr_t;  enum { -	FILE_FLAG_HAS_FRAGMENT = 0x01, - -	FILE_FLAG_FRAGMENT_IS_DUPLICATE = 0x02, - -	FILE_FLAG_BLOCKS_ARE_DUPLICATE = 0x04, -}; - -enum {  	DIR_SCAN_KEEP_TIME = 0x01,  	DIR_SCAN_ONE_FILESYSTEM = 0x02, @@ -99,9 +91,6 @@ struct file_info_t {  	/* Byte offset into the fragment block. */  	uint32_t fragment_offset; -	/* combination of FILE_FLAG_* flags */ -	uint32_t flags; -  	/* Stores data about each full data block. */  	/* Bit (1 << 24) is set if the block is stored uncompressed. */  	uint32_t block_size[]; diff --git a/include/highlevel.h b/include/highlevel.h index 4c560f7..8173d6f 100644 --- a/include/highlevel.h +++ b/include/highlevel.h @@ -19,6 +19,7 @@  #include "sqfs/dir.h"  #include "sqfs/io.h"  #include "data_reader.h" +#include "data_writer.h"  #include "fstree.h"  #include <stdint.h> @@ -63,8 +64,7 @@ int sqfs_serialize_fstree(sqfs_file_t *file, sqfs_super_t *super, fstree_t *fs,   */  tree_node_t *tree_node_from_inode(sqfs_inode_generic_t *inode,  				  const sqfs_id_table_t *idtbl, -				  const char *name, -				  size_t block_size); +				  const char *name);  /*    Restore a file system tree from a squashfs image. The given flags are a @@ -92,7 +92,7 @@ int write_export_table(sqfs_file_t *file, fstree_t *fs, sqfs_super_t *super,  		       sqfs_compressor_t *cmp);  /* Print out fancy statistics for squashfs packing tools */ -void sqfs_print_statistics(fstree_t *fs, sqfs_super_t *super); +void sqfs_print_statistics(sqfs_super_t *super, data_writer_stats_t *stats);  /* Open a squashfs file, extract all the information we may need and     construct datastructures we need to access its contents. | 
