summaryrefslogtreecommitdiff
path: root/cmd/btrfs-rec/inspect/rebuildmappings
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-03-17 18:38:14 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2023-03-17 18:38:14 -0400
commit0f85e72d1331b49b52925d6cc5ad083a0376104c (patch)
tree9ba66e893d6f66096f6b06284d09c8eb3e50facc /cmd/btrfs-rec/inspect/rebuildmappings
parentc0f33186aa7a8903c5e7406024f13fad48cd14e3 (diff)
parent1ea26f04701fa66e36b058f3efb3a6c7059cdc5c (diff)
Merge branch 'lukeshu/lint'
Diffstat (limited to 'cmd/btrfs-rec/inspect/rebuildmappings')
-rw-r--r--cmd/btrfs-rec/inspect/rebuildmappings/process.go3
-rw-r--r--cmd/btrfs-rec/inspect/rebuildmappings/scan.go6
2 files changed, 6 insertions, 3 deletions
diff --git a/cmd/btrfs-rec/inspect/rebuildmappings/process.go b/cmd/btrfs-rec/inspect/rebuildmappings/process.go
index 7ce3748..a93b697 100644
--- a/cmd/btrfs-rec/inspect/rebuildmappings/process.go
+++ b/cmd/btrfs-rec/inspect/rebuildmappings/process.go
@@ -2,6 +2,9 @@
//
// SPDX-License-Identifier: GPL-2.0-or-later
+// Package rebuildmappings is the guts of the `btrfs-rec inspect
+// rebuild-mappings` command, which rebuilds broken
+// chunk/dev-extent/blockgroup trees.
package rebuildmappings
import (
diff --git a/cmd/btrfs-rec/inspect/rebuildmappings/scan.go b/cmd/btrfs-rec/inspect/rebuildmappings/scan.go
index f9c3bf3..b88f01c 100644
--- a/cmd/btrfs-rec/inspect/rebuildmappings/scan.go
+++ b/cmd/btrfs-rec/inspect/rebuildmappings/scan.go
@@ -103,7 +103,7 @@ func (scanner *deviceScanner) ScanStats() scanStats {
}
}
-func newDeviceScanner(ctx context.Context, sb btrfstree.Superblock, numBytes btrfsvol.PhysicalAddr, numSectors int) btrfsutil.DeviceScanner[scanStats, ScanOneDeviceResult] {
+func newDeviceScanner(_ context.Context, sb btrfstree.Superblock, _ btrfsvol.PhysicalAddr, numSectors int) btrfsutil.DeviceScanner[scanStats, ScanOneDeviceResult] {
scanner := new(deviceScanner)
scanner.alg = sb.ChecksumType
scanner.result.FoundNodes = make(map[btrfsvol.LogicalAddr][]btrfsvol.PhysicalAddr)
@@ -112,7 +112,7 @@ func newDeviceScanner(ctx context.Context, sb btrfstree.Superblock, numBytes btr
return scanner
}
-func (scanner *deviceScanner) ScanSector(ctx context.Context, dev *btrfs.Device, paddr btrfsvol.PhysicalAddr) error {
+func (scanner *deviceScanner) ScanSector(_ context.Context, dev *btrfs.Device, paddr btrfsvol.PhysicalAddr) error {
sum, err := btrfs.ChecksumPhysical(dev, scanner.alg, paddr)
if err != nil {
return err
@@ -190,7 +190,7 @@ func (scanner *deviceScanner) ScanNode(ctx context.Context, nodeRef *diskio.Ref[
return nil
}
-func (scanner *deviceScanner) ScanDone(ctx context.Context) (ScanOneDeviceResult, error) {
+func (scanner *deviceScanner) ScanDone(_ context.Context) (ScanOneDeviceResult, error) {
scanner.result.Checksums.Sums = btrfssum.ShortSum(scanner.sums.String())
return scanner.result, nil
}