summaryrefslogtreecommitdiff
path: root/lib/sqfshelper/statistics.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-25 13:40:48 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-25 13:40:48 +0200
commitde4fc4b7e7b4302388cc1f778025f0843ef4ab24 (patch)
treeacdd35e6ecf220f06b236f25574b8ef8f3463fb9 /lib/sqfshelper/statistics.c
parente0e98b7b747f63c1b8fccd035592e3684fdb2691 (diff)
Do the statistics acocunting through data writer hooks
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfshelper/statistics.c')
-rw-r--r--lib/sqfshelper/statistics.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/sqfshelper/statistics.c b/lib/sqfshelper/statistics.c
index fda4c3f..87efc30 100644
--- a/lib/sqfshelper/statistics.c
+++ b/lib/sqfshelper/statistics.c
@@ -11,11 +11,10 @@
void sqfs_print_statistics(sqfs_super_t *super, data_writer_stats_t *stats)
{
- uint64_t bytes_written = super->inode_table_start - sizeof(*super);
size_t ratio;
- if (bytes_written > 0) {
- ratio = (100 * bytes_written) / stats->bytes_read;
+ if (stats->bytes_written > 0) {
+ ratio = (100 * stats->bytes_written) / stats->bytes_read;
} else {
ratio = 100;
}