summaryrefslogtreecommitdiff
path: root/lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-08-26 23:24:53 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2022-08-26 23:24:53 -0600
commit28c5bd2ae25aa11502f4dcdcb379183d4229124f (patch)
tree6893ce6df27b3e8a010bbee2dbda7b0c6343dccd /lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go
parentf99e6dbce1ede51bf54019dc4dfc63ebe5d30e1b (diff)
slooooowwwww
Diffstat (limited to 'lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go')
-rw-r--r--lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go b/lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go
index 15cdf11..4d7c112 100644
--- a/lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go
+++ b/lib/btrfsprogs/btrfsinspect/rebuildmappings/rebuildmappings.go
@@ -51,8 +51,8 @@ func RebuildMappings(ctx context.Context, fs *btrfs.FS, scanResults btrfsinspect
dlog.Infof(ctx, "plan: 2/6 process %d device extents", numDevExts)
dlog.Infof(ctx, "plan: 3/6 process %d nodes", numNodes)
dlog.Infof(ctx, "plan: 4/6 process %d block groups", numBlockGroups)
- dlog.Infof(ctx, "plan: 5/6 process sums of block groups")
- dlog.Infof(ctx, "plan: 6/6 process remaining sums")
+ dlog.Infof(ctx, "plan: 5/6 search for block groups in checksum map (exact)")
+ dlog.Infof(ctx, "plan: 6/6 search for block groups in checksum map (fuzzy)")
dlog.Infof(ctx, "1/6: Processing %d chunks...", numChunks)
for _, devID := range devIDs {
@@ -143,14 +143,19 @@ func RebuildMappings(ctx context.Context, fs *btrfs.FS, scanResults btrfsinspect
}
dlog.Info(ctx, "... done processing block groups")
- dlog.Infof(ctx, "5/6: Processing sums of %d block groups", len(bgs))
+ dlog.Infof(ctx, "5/6: Searching for %d block groups in checksum map (exact)...", len(bgs))
physicalSums := ExtractPhysicalSums(scanResults)
logicalSums := ExtractLogicalSums(ctx, scanResults)
if err := matchBlockGroupSums(ctx, fs, bgs, physicalSums, logicalSums); err != nil {
return err
}
+ dlog.Info(ctx, "... done searching for exact block groups")
- dlog.Infof(ctx, "6/6: process remaining sums: TODO")
+ dlog.Infof(ctx, "6/6: Searching for %d block groups in checksum map (fuzzy)...", len(bgs))
+ if err := fuzzyMatchBlockGroupSums(ctx, fs, bgs, physicalSums, logicalSums); err != nil {
+ return err
+ }
+ dlog.Info(ctx, "... done searching for fuzzy block groups")
dlog.Info(ctx, "report:")
p := message.NewPrinter(message.MatchLanguage("en"))