diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-29 10:00:18 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-30 00:11:57 -0600 |
commit | 2eb7033431866cb05d235eb10c280a4810bf88a7 (patch) | |
tree | 28ace712f93f2300e18442cf418f15fc1fad16d7 /lib/btrfs/btrfstree/types_node.go | |
parent | 7f1391d48d63a5f8780dddc41817eaa9df3ce880 (diff) |
btrfstree: Divorce ReadNode from NodeExpectations
Diffstat (limited to 'lib/btrfs/btrfstree/types_node.go')
-rw-r--r-- | lib/btrfs/btrfstree/types_node.go | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/btrfs/btrfstree/types_node.go b/lib/btrfs/btrfstree/types_node.go index 28b93cf..082be2c 100644 --- a/lib/btrfs/btrfstree/types_node.go +++ b/lib/btrfs/btrfstree/types_node.go @@ -446,7 +446,7 @@ var nodePool = typedsync.Pool[*Node]{ // returned. The error returned (if non-nil) is always of type // *NodeError[Addr]. Notable errors that may be inside of the // NodeError are ErrNotANode and *IOError. -func ReadNode[Addr ~int64](fs diskio.ReaderAt[Addr], sb Superblock, addr Addr, exp NodeExpectations) (*Node, error) { +func ReadNode[Addr ~int64](fs diskio.ReaderAt[Addr], sb Superblock, addr Addr) (*Node, error) { if int(sb.NodeSize) < nodeHeaderSize { return nil, &NodeError[Addr]{ Op: "btrfstree.ReadNode", NodeAddr: addr, @@ -512,12 +512,6 @@ func ReadNode[Addr ~int64](fs diskio.ReaderAt[Addr], sb Superblock, addr Addr, e bytePool.Put(nodeBuf) - // sanity checking (that doesn't prevent parsing) - - if err := exp.Check(node); err != nil { - return node, &NodeError[Addr]{Op: "btrfstree.ReadNode", NodeAddr: addr, Err: err} - } - // return return node, nil |