aboutsummaryrefslogtreecommitdiff
path: root/mkfs/mkfs.h
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-11 01:24:57 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-11 01:47:18 +0200
commit5038c4b33ea403203b8edd82b44a8db06464409b (patch)
treeb0d8b380601694f47a6dd45f4c6313fc7d9f0937 /mkfs/mkfs.h
parentb45eead4dfd6e820b4c1634ae72398bf717193f9 (diff)
Major cleanup of mkfs block processor
This commit tries to make the block and fragment processing code a lot more readable by simplifying it as follows. The following pattern is used repeatedly: - Try to compress a block - Write the compressed if smaller (the original otherwise) to a file - Print errors on the way - Set the magic (1 << 24) flag if we wrote the original - Increment the super block byte counter => Move that to a seperate function called "write_compressed" => Move the code to grow the fragment table is moved to a seperate function. => Clearing the fragment buffer is pointless, so remove that The add_fragment/add_block functions are now trivial => Merge them into process_file => Global block counter no longer needed, so remove that too Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'mkfs/mkfs.h')
-rw-r--r--mkfs/mkfs.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/mkfs/mkfs.h b/mkfs/mkfs.h
index c4cd8a1..fe4123b 100644
--- a/mkfs/mkfs.h
+++ b/mkfs/mkfs.h
@@ -47,8 +47,6 @@ typedef struct {
sqfs_fragment_t *fragments;
size_t num_fragments;
size_t max_fragments;
-
- int file_block_count;
size_t frag_offset;
id_table_t idtbl;