diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-08-27 00:51:34 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-08-27 00:51:34 -0600 |
commit | 0d9229ff268951d890c57a9a212afeb7fa89e732 (patch) | |
tree | f18b62bac80c5ef432fc09a5658e4ac8fca1c5e4 | |
parent | cbe18889635133dde7a0014240fe896cb43f5106 (diff) |
logging
-rw-r--r-- | lib/btrfsprogs/btrfsinspect/rebuildmappings/fuzzymatchsums.go | 4 | ||||
-rw-r--r-- | lib/btrfsprogs/btrfsinspect/rebuildmappings/matchsums.go | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/btrfsprogs/btrfsinspect/rebuildmappings/fuzzymatchsums.go b/lib/btrfsprogs/btrfsinspect/rebuildmappings/fuzzymatchsums.go index 1e47218..d326299 100644 --- a/lib/btrfsprogs/btrfsinspect/rebuildmappings/fuzzymatchsums.go +++ b/lib/btrfsprogs/btrfsinspect/rebuildmappings/fuzzymatchsums.go @@ -60,6 +60,7 @@ func fuzzyMatchBlockGroupSums(ctx context.Context, dlog.Info(ctx, "... ... done indexing") dlog.Info(ctx, "... Searching...") + numBlockgroups := len(blockgroups) for i, bgLAddr := range maps.SortedKeys(blockgroups) { blockgroup := blockgroups[bgLAddr] bgRun := SumsForLogicalRegion(logicalSums, blockgroup.LAddr, blockgroup.Size) @@ -108,7 +109,7 @@ func fuzzyMatchBlockGroupSums(ctx context.Context, lvl = dlog.LogLevelInfo } dlog.Logf(ctx, lvl, "... (%v/%v) blockgroup[laddr=%v] matches=[%s]; bestpossible=%v%% (based on %v runs)", - i+1, len(blockgroups), bgLAddr, matchesStr, int(100*bgRun.PctFull()), len(bgRun.Runs)) + i+1, numBlockgroups, bgLAddr, matchesStr, int(100*bgRun.PctFull()), len(bgRun.Runs)) if !apply { continue } @@ -129,6 +130,7 @@ func fuzzyMatchBlockGroupSums(ctx context.Context, } delete(blockgroups, bgLAddr) } + dlog.Info(ctx, "... ... done searcihng") return nil } diff --git a/lib/btrfsprogs/btrfsinspect/rebuildmappings/matchsums.go b/lib/btrfsprogs/btrfsinspect/rebuildmappings/matchsums.go index 4ee8207..6a8333a 100644 --- a/lib/btrfsprogs/btrfsinspect/rebuildmappings/matchsums.go +++ b/lib/btrfsprogs/btrfsinspect/rebuildmappings/matchsums.go @@ -24,12 +24,13 @@ func matchBlockGroupSums(ctx context.Context, logicalSums btrfssum.SumRunWithGaps[btrfsvol.LogicalAddr], ) error { regions := ListUnmappedPhysicalRegions(fs) + numBlockgroups := len(blockgroups) for i, bgLAddr := range maps.SortedKeys(blockgroups) { blockgroup := blockgroups[bgLAddr] bgRun := SumsForLogicalRegion(logicalSums, blockgroup.LAddr, blockgroup.Size) if len(bgRun.Runs) == 0 { dlog.Errorf(ctx, "... (%v/%v) blockgroup[laddr=%v] can't be matched because it has 0 runs", - i+1, len(blockgroups), bgLAddr) + i+1, numBlockgroups, bgLAddr) continue } @@ -55,7 +56,7 @@ func matchBlockGroupSums(ctx context.Context, lvl = dlog.LogLevelInfo } dlog.Logf(ctx, lvl, "... (%v/%v) blockgroup[laddr=%v] has %v matches based on %v%% coverage from %v runs", - i+1, len(blockgroups), bgLAddr, len(matches), int(100*bgRun.PctFull()), len(bgRun.Runs)) + i+1, numBlockgroups, bgLAddr, len(matches), int(100*bgRun.PctFull()), len(bgRun.Runs)) if len(matches) != 1 { continue } |