diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-29 17:11:27 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-30 00:11:57 -0600 |
commit | 7f1391d48d63a5f8780dddc41817eaa9df3ce880 (patch) | |
tree | 976590735a86c09059e3eb22cf65e0d851d4ce08 /lib/btrfs/io3_btree.go | |
parent | 755ac780df4f653879cb376d27cad7ff8e8d7b0f (diff) |
tree-wide: Funnel all btrfstree.ReadNode[btrfsvol.LogicalAddr]() calls through btrfstree.NodeSource.ReadNode()
Diffstat (limited to 'lib/btrfs/io3_btree.go')
-rw-r--r-- | lib/btrfs/io3_btree.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/btrfs/io3_btree.go b/lib/btrfs/io3_btree.go index f1436fb..bb68d7d 100644 --- a/lib/btrfs/io3_btree.go +++ b/lib/btrfs/io3_btree.go @@ -6,10 +6,12 @@ package btrfs import ( "context" + "fmt" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsitem" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsprim" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfstree" + "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsvol" ) // This file is ordered from low-level to high-level. @@ -79,8 +81,12 @@ var _ btrfstree.NodeFile = (*FS)(nil) // btrfstree.NodeSource //////////////////////////////////////////////////////// // ReadNode implements btrfstree.NodeSource. -func (fs *FS) ReadNode(path btrfstree.Path) (*btrfstree.Node, error) { - return btrfstree.FSReadNode(fs, path) +func (fs *FS) ReadNode(_ context.Context, addr btrfsvol.LogicalAddr, exp btrfstree.NodeExpectations) (*btrfstree.Node, error) { + sb, err := fs.Superblock() + if err != nil { + return nil, fmt.Errorf("btrfs.FS.ReadNode: %w", err) + } + return btrfstree.ReadNode[btrfsvol.LogicalAddr](fs, *sb, addr, exp) } var _ btrfstree.NodeSource = (*FS)(nil) |