diff --git a/src/main.c b/src/main.c index bb219eab..8ad0b79a 100644 --- a/src/main.c +++ b/src/main.c @@ -205,6 +205,7 @@ int main(int argc, char **argv) { /// get Super Block information from partition read_super_blocks(source, &fs_info); + fs_info.superBlockUsedBlocks = fs_info.usedblocks; if (img_opt.checksum_mode != CSM_NONE && img_opt.blocks_per_checksum == 0) { @@ -308,6 +309,7 @@ int main(int argc, char **argv) { /// get Super Block information from partition read_super_blocks(source, &fs_info); + fs_info.superBlockUsedBlocks = fs_info.usedblocks; check_mem_size(fs_info, img_opt, opt); @@ -339,6 +341,7 @@ int main(int argc, char **argv) { if (dfr != 0){ fs_info.device_size = get_partition_size(&dfr); read_super_blocks(source, &fs_info); + fs_info.superBlockUsedBlocks = fs_info.usedblocks; }else{ if (target_stdout) { log_mesg(0, 1, 1, debug, "%s, %i, stdout is not supported\n", __func__, __LINE__); @@ -352,6 +355,7 @@ int main(int argc, char **argv) { fs_info.device_size = get_free_space(target); } read_super_blocks(target, &fs_info); + fs_info.superBlockUsedBlocks = fs_info.usedblocks; } img_opt.checksum_mode = opt.checksum_mode; img_opt.checksum_size = get_checksum_size(opt.checksum_mode, opt.debug); diff --git a/src/partclone.c b/src/partclone.c index e401406f..40272335 100644 --- a/src/partclone.c +++ b/src/partclone.c @@ -1222,7 +1222,7 @@ void update_used_blocks_count(file_system_info* fs_info, unsigned long* bitmap) ++used; } - fs_info->used_bitmap = used; + fs_info->usedblocks = used; } @@ -1907,7 +1907,7 @@ void print_file_system_info(file_system_info fs_info, cmd_opt opt) { unsigned int block_s = fs_info.block_size; unsigned long long total = fs_info.totalblock; unsigned long long used = fs_info.usedblocks; - unsigned long long used_bitmap = fs_info.used_bitmap; + unsigned long long superBlockUsedBlocks = fs_info.superBlockUsedBlocks; int debug = opt.debug; char size_str[11]; @@ -1926,7 +1926,7 @@ void print_file_system_info(file_system_info fs_info, cmd_opt opt) { log_mesg(0, 0, 1, debug, _("Free Space: %s = %llu Blocks\n"), size_str, (total-used)); log_mesg(0, 0, 1, debug, _("Block size: %i Byte\n"), block_s); - log_mesg(2, 0, 1, debug, _("Used Blocks in Bitmap: %llu Blocks\n"), used_bitmap); + log_mesg(2, 0, 1, debug, _("Used Blocks in Super-Block: %llu Blocks\n"), superBlockUsedBlocks); } /// print image info diff --git a/src/partclone.h b/src/partclone.h index e1933b28..c97e86c2 100644 --- a/src/partclone.h +++ b/src/partclone.h @@ -181,10 +181,10 @@ typedef struct unsigned long long totalblock; /// Number of blocks in use as reported by the file system - unsigned long long usedblocks; + unsigned long long superBlockUsedBlocks; /// Number of blocks in use in the bitmap - unsigned long long used_bitmap; + unsigned long long usedblocks; /// Number of bytes in each block unsigned int block_size;