summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-08-24 15:00:23 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2022-08-24 15:00:23 -0600
commitab9df81dfa02b7fd064c5159b23a47b098da22f5 (patch)
tree35f26d6876dd0fba863457bfc0c02186d6148eee /lib
parentc95ae0b25133dc068e3d471a4a2c798be45b7930 (diff)
rebuildmappings: Add thousands separators to numbers in the final report
Diffstat (limited to 'lib')
-rw-r--r--lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go b/lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go
index 09b2185..15cdf11 100644
--- a/lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go
+++ b/lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go
@@ -9,6 +9,7 @@ import (
"fmt"
"github.com/datawire/dlib/dlog"
+ "golang.org/x/text/message"
"git.lukeshu.com/btrfs-progs-ng/lib/btrfs"
"git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsvol"
@@ -151,7 +152,8 @@ func RebuildMappings(ctx context.Context, fs *btrfs.FS, scanResults btrfsinspect
dlog.Infof(ctx, "6/6: process remaining sums: TODO")
- dlog.Infof(ctx, "report:")
+ dlog.Info(ctx, "report:")
+ p := message.NewPrinter(message.MatchLanguage("en"))
unmappedPhysicalRegions := ListUnmappedPhysicalRegions(fs)
var unmappedPhysical btrfsvol.AddrDelta
var numUnmappedPhysical int
@@ -161,18 +163,18 @@ func RebuildMappings(ctx context.Context, fs *btrfs.FS, scanResults btrfsinspect
unmappedPhysical += region.End.Sub(region.Beg)
}
}
- dlog.Infof(ctx, "... %d KiB of unmapped physical space (across %d regions)", unmappedPhysical/1024, numUnmappedPhysical)
+ dlog.Info(ctx, p.Sprintf("... %d KiB of unmapped physical space (across %d regions)", int(unmappedPhysical/1024), numUnmappedPhysical))
unmappedLogicalRegions := ListUnmappedLogicalRegions(fs, logicalSums)
var unmappedLogical btrfsvol.AddrDelta
for _, region := range unmappedLogicalRegions {
unmappedLogical += region.Size()
}
- dlog.Infof(ctx, "... %d KiB of unmapped summed logical space (across %d regions)", unmappedLogical/1024, len(unmappedLogicalRegions))
+ dlog.Info(ctx, p.Sprintf("... %d KiB of unmapped summed logical space (across %d regions)", int(unmappedLogical/1024), len(unmappedLogicalRegions)))
var unmappedBlockGroups btrfsvol.AddrDelta
for _, bg := range bgs {
unmappedBlockGroups += bg.Size
}
- dlog.Infof(ctx, "... %d KiB of unmapped block groups (across %d groups)", unmappedBlockGroups/1024, len(bgs))
+ dlog.Info(ctx, p.Sprintf("... %d KiB of unmapped block groups (across %d groups)", int(unmappedBlockGroups/1024), len(bgs)))
return nil
}