diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-06-05 18:27:23 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-06-05 18:27:23 -0600 |
commit | 7ef276daaa132683ff8b04004f1ce5c992097d14 (patch) | |
tree | ad58a97758e9706e169125bb4f1954a880bd0a04 /pkg/btrfsmisc | |
parent | 74b109b0a75ae6648f9381252d8beb5ce6025df3 (diff) |
arrays can be compared directly
Diffstat (limited to 'pkg/btrfsmisc')
-rw-r--r-- | pkg/btrfsmisc/fsck.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/btrfsmisc/fsck.go b/pkg/btrfsmisc/fsck.go index 527329d..77305f8 100644 --- a/pkg/btrfsmisc/fsck.go +++ b/pkg/btrfsmisc/fsck.go @@ -35,11 +35,11 @@ func ScanForNodes(dev *btrfs.Device, sb btrfs.Superblock) error { if _, err := binstruct.Unmarshal(nodeBuf, &nodeHeader); err != nil { return fmt.Errorf("sector@%d: %w", pos, err) } - if !nodeHeader.MetadataUUID.Equal(sb.EffectiveMetadataUUID()) { + if nodeHeader.MetadataUUID != sb.EffectiveMetadataUUID() { //fmt.Printf("sector@%d does not look like a node\n", pos) continue } - if !nodeHeader.Checksum.Equal(btrfs.CRC32c(nodeBuf[0x20:])) { + if nodeHeader.Checksum != btrfs.CRC32c(nodeBuf[0x20:]) { fmt.Printf("sector@%d looks like a node but is corrupt (checksum doesn't match)\n", pos) continue } |