summaryrefslogtreecommitdiff
path: root/lib/btrfs/btrfstree
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-03-20 12:29:20 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2023-03-23 18:24:47 -0600
commitbbabc9ab42accbd37072735419cc0552dc8917ee (patch)
treec4c5cb71e673d4f8a194013ce31123f98d52a20c /lib/btrfs/btrfstree
parentba8fd9042ad4a5da3f5d2e3db6350793666ea403 (diff)
btrfs: Subvolume: Use LookupTreeRoot
Diffstat (limited to 'lib/btrfs/btrfstree')
-rw-r--r--lib/btrfs/btrfstree/btree_forrest.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/btrfs/btrfstree/btree_forrest.go b/lib/btrfs/btrfstree/btree_forrest.go
index 197edc2..38a2721 100644
--- a/lib/btrfs/btrfstree/btree_forrest.go
+++ b/lib/btrfs/btrfstree/btree_forrest.go
@@ -21,6 +21,8 @@ type TreeRoot struct {
RootNode btrfsvol.LogicalAddr
Level uint8
Generation btrfsprim.Generation
+
+ RootInode btrfsprim.ObjID // only for subvolume trees
}
// LookupTreeRoot is a utility function to help with implementing the
@@ -70,6 +72,7 @@ func LookupTreeRoot(_ context.Context, fs TreeOperator, sb Superblock, treeID bt
RootNode: rootItemBody.ByteNr,
Level: rootItemBody.Level,
Generation: rootItemBody.Generation,
+ RootInode: rootItemBody.RootDirID,
}, nil
case *btrfsitem.Error:
return nil, fmt.Errorf("malformed ROOT_ITEM for tree %v: %w", treeID, rootItemBody.Err)