diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-17 23:54:56 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-17 23:54:56 -0400 |
commit | 0f96c9ce920875babd4cd23819a2fb2960dc0cc6 (patch) | |
tree | f50d5a547f354413f45b9a9d497af77a31a7d10b /lib/btrfs/btrfstree/readnode.go | |
parent | 0f85e72d1331b49b52925d6cc5ad083a0376104c (diff) | |
parent | 3fea600da8e033abb7e415694e53aaf0787ed95c (diff) |
Merge branch 'lukeshu/api-cleanup'
Diffstat (limited to 'lib/btrfs/btrfstree/readnode.go')
-rw-r--r-- | lib/btrfs/btrfstree/readnode.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/btrfs/btrfstree/readnode.go b/lib/btrfs/btrfstree/readnode.go index 4ccc17b..c2e3b0f 100644 --- a/lib/btrfs/btrfstree/readnode.go +++ b/lib/btrfs/btrfstree/readnode.go @@ -1,4 +1,4 @@ -// Copyright (C) 2022 Luke Shumaker <lukeshu@lukeshu.com> +// Copyright (C) 2022-2023 Luke Shumaker <lukeshu@lukeshu.com> // // SPDX-License-Identifier: GPL-2.0-or-later @@ -33,8 +33,8 @@ type NodeFile interface { // 'NodeSource' interface. func FSReadNode( fs NodeFile, - path TreePath, -) (*diskio.Ref[btrfsvol.LogicalAddr, Node], error) { + path Path, +) (*Node, error) { sb, err := fs.Superblock() if err != nil { return nil, fmt.Errorf("btrfs.FS.ReadNode: %w", err) @@ -63,11 +63,11 @@ func FSReadNode( } return ReadNode[btrfsvol.LogicalAddr](fs, *sb, path.Node(-1).ToNodeAddr, NodeExpectations{ - LAddr: containers.Optional[btrfsvol.LogicalAddr]{OK: true, Val: path.Node(-1).ToNodeAddr}, - Level: containers.Optional[uint8]{OK: true, Val: path.Node(-1).ToNodeLevel}, - Generation: containers.Optional[btrfsprim.Generation]{OK: true, Val: path.Node(-1).ToNodeGeneration}, + LAddr: containers.OptionalValue(path.Node(-1).ToNodeAddr), + Level: containers.OptionalValue(path.Node(-1).ToNodeLevel), + Generation: containers.OptionalValue(path.Node(-1).ToNodeGeneration), Owner: checkOwner, - MinItem: containers.Optional[btrfsprim.Key]{OK: true, Val: path.Node(-1).ToKey}, - MaxItem: containers.Optional[btrfsprim.Key]{OK: true, Val: path.Node(-1).ToMaxKey}, + MinItem: containers.OptionalValue(path.Node(-1).ToKey), + MaxItem: containers.OptionalValue(path.Node(-1).ToMaxKey), }) } |