summaryrefslogtreecommitdiff
path: root/mkfs/mkfs.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-09 11:45:26 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-09 12:03:15 +0200
commit8ef9f10b20e313db5edd0b9c11ecdd8690812b8d (patch)
tree2695e7026197e016702abfa963f4034ca72e9362 /mkfs/mkfs.c
parent526fd8b4969b2efe62e0fbc339a7b7dafefb7729 (diff)
Remove ad-hoc image size accounting
Much simpler to just set the correct size in the end, before writing the super block. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'mkfs/mkfs.c')
-rw-r--r--mkfs/mkfs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mkfs/mkfs.c b/mkfs/mkfs.c
index 05e8481..919ec20 100644
--- a/mkfs/mkfs.c
+++ b/mkfs/mkfs.c
@@ -161,10 +161,8 @@ int main(int argc, char **argv)
if (ret < 0)
goto out_cmp;
- if (ret > 0) {
+ if (ret > 0)
super.flags |= SQFS_FLAG_COMPRESSOR_OPTIONS;
- super.bytes_used += ret;
- }
data = data_writer_create(&super, cmp, outfile,
opt.devblksz, opt.num_jobs);
@@ -191,6 +189,8 @@ int main(int argc, char **argv)
if (write_xattr(outfile, &fs, &super, cmp))
goto out_data;
+ super.bytes_used = outfile->get_size(outfile);
+
if (sqfs_super_write(&super, outfile))
goto out_data;