bitmap: print correct percentage of bitmap in use.
We were adding 1, presumably to avoid div-by-zero possibilities. It is better to only substitute '1' if the value actually is zero, else for small numbers of bits the difference is visible. Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
7b80ad6af2
commit
6c9a5fa103
2
bitmap.c
2
bitmap.c
|
@ -334,7 +334,7 @@ int ExamineBitmap(char *filename, int brief, struct supertype *st)
|
|||
goto free_info;
|
||||
printf(" Bitmap : %llu bits (chunks), %llu dirty (%2.1f%%)\n",
|
||||
info->total_bits, info->dirty_bits,
|
||||
100.0 * info->dirty_bits / (info->total_bits + 1));
|
||||
100.0 * info->dirty_bits / (info->total_bits?:1));
|
||||
free_info:
|
||||
free(info);
|
||||
return rv;
|
||||
|
|
Loading…
Reference in New Issue