diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-22 13:43:15 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-23 18:35:46 -0600 |
commit | d11a5357df7d155a7a3e92a67971d3d52ff6ad86 (patch) | |
tree | 1d9bfe0ce8b12bb2698f2ff961198534718ba051 /lib/btrfs | |
parent | 5520c20c493d52d83288bc2e321117006e38fd1a (diff) |
btrfstree: Add a 'generation' argument the owner validation
Validating a node's owner properly requires the generation.
But don't worry about actually doing it properly yet, just update the API
first.
Diffstat (limited to 'lib/btrfs')
-rw-r--r-- | lib/btrfs/btrfstree/readnode.go | 2 | ||||
-rw-r--r-- | lib/btrfs/btrfstree/types_node.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/btrfs/btrfstree/readnode.go b/lib/btrfs/btrfstree/readnode.go index c2e3b0f..7cc42f5 100644 --- a/lib/btrfs/btrfstree/readnode.go +++ b/lib/btrfs/btrfstree/readnode.go @@ -41,7 +41,7 @@ func FSReadNode( } var treeParents []btrfsprim.ObjID - checkOwner := func(owner btrfsprim.ObjID) error { + checkOwner := func(owner btrfsprim.ObjID, _ btrfsprim.Generation) error { exp := path.Node(-1).FromTree for { if owner == exp { diff --git a/lib/btrfs/btrfstree/types_node.go b/lib/btrfs/btrfstree/types_node.go index 622f23c..bfcbbf4 100644 --- a/lib/btrfs/btrfstree/types_node.go +++ b/lib/btrfs/btrfstree/types_node.go @@ -417,7 +417,7 @@ type NodeExpectations struct { // Things knowable from the parent. Level containers.Optional[uint8] Generation containers.Optional[btrfsprim.Generation] - Owner func(btrfsprim.ObjID) error + Owner func(btrfsprim.ObjID, btrfsprim.Generation) error MinItem containers.Optional[btrfsprim.Key] // Things knowable from the structure of the tree. MaxItem containers.Optional[btrfsprim.Key] @@ -547,7 +547,7 @@ func (exp NodeExpectations) Check(node *Node) error { exp.Generation.Val, node.Head.Generation)) } if exp.Owner != nil { - if err := exp.Owner(node.Head.Owner); err != nil { + if err := exp.Owner(node.Head.Owner, node.Head.Generation); err != nil { errs = append(errs, err) } } |