summaryrefslogtreecommitdiff
path: root/cmd/btrfs-dump-tree/main.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-06-03 22:51:43 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2022-06-03 22:51:43 -0600
commit10605d5b5109bd796fb456e0a6b91f64e278a00c (patch)
tree34470a92e722edc07a98961fb7899d724e31eca1 /cmd/btrfs-dump-tree/main.go
parent774b5baa5aa5772b29865e8a570025d94ec34d2a (diff)
implement node checksums
Diffstat (limited to 'cmd/btrfs-dump-tree/main.go')
-rw-r--r--cmd/btrfs-dump-tree/main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/btrfs-dump-tree/main.go b/cmd/btrfs-dump-tree/main.go
index b51e999..f1d9112 100644
--- a/cmd/btrfs-dump-tree/main.go
+++ b/cmd/btrfs-dump-tree/main.go
@@ -250,7 +250,11 @@ func printHeaderInfo(node btrfs.Node) {
node.Head.BackrefRev)
fmt.Printf("checksum stored %x\n", node.Head.Checksum)
- fmt.Printf("checksum calced %v\n", "TODO")
+ if calcSum, err := node.CalculateChecksum(); err != nil {
+ fmt.Printf("checksum calced %v\n", err)
+ } else {
+ fmt.Printf("checksum calced %x\n", calcSum)
+ }
fmt.Printf("fs uuid %s\n", node.Head.MetadataUUID)
fmt.Printf("chunk uuid %s\n", node.Head.ChunkTreeUUID)