diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-12-23 18:00:47 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-12-23 19:57:21 -0700 |
commit | 7ca8e6805164a5855c4af6ec5103c8e0cbcab89c (patch) | |
tree | 3739be1cbe367fbf0ce069803e23fddc5492fa39 | |
parent | 6330b26a9f9c7769c48e2bc90e065457f8e138ab (diff) |
rebuildnodes: Move keyio.KeyAndTree→keyAndtree
-rw-r--r-- | lib/btrfsprogs/btrfsinspect/rebuildnodes/keyio/keyio.go | 12 | ||||
-rw-r--r-- | lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go | 18 |
2 files changed, 15 insertions, 15 deletions
diff --git a/lib/btrfsprogs/btrfsinspect/rebuildnodes/keyio/keyio.go b/lib/btrfsprogs/btrfsinspect/rebuildnodes/keyio/keyio.go index 5ae9ce2..fa69c78 100644 --- a/lib/btrfsprogs/btrfsinspect/rebuildnodes/keyio/keyio.go +++ b/lib/btrfsprogs/btrfsinspect/rebuildnodes/keyio/keyio.go @@ -16,18 +16,6 @@ import ( "git.lukeshu.com/btrfs-progs-ng/lib/diskio" ) -type KeyAndTree struct { - btrfsprim.Key - TreeID btrfsprim.ObjID -} - -func (a KeyAndTree) Cmp(b KeyAndTree) int { - if d := a.Key.Cmp(b.Key); d != 0 { - return d - } - return containers.NativeCmp(a.TreeID, b.TreeID) -} - type ItemPtr struct { Node btrfsvol.LogicalAddr Idx int diff --git a/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go b/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go index 982c27d..00dbad5 100644 --- a/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go +++ b/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go @@ -28,6 +28,18 @@ import ( "git.lukeshu.com/btrfs-progs-ng/lib/textui" ) +type keyAndTree struct { + btrfsprim.Key + TreeID btrfsprim.ObjID +} + +func (a keyAndTree) Cmp(b keyAndTree) int { + if d := a.Key.Cmp(b.Key); d != 0 { + return d + } + return containers.NativeCmp(a.TreeID, b.TreeID) +} + type rebuilder struct { sb btrfstree.Superblock rebuilt *btrees.RebuiltTrees @@ -36,8 +48,8 @@ type rebuilder struct { csums containers.RBTree[containers.NativeOrdered[btrfsvol.LogicalAddr], btrfsinspect.SysExtentCSum] keyIO *keyio.Handle - curKey keyio.KeyAndTree - queue []keyio.KeyAndTree + curKey keyAndTree + queue []keyAndTree pendingAugments map[btrfsprim.ObjID][]map[btrfsvol.LogicalAddr]int } @@ -179,7 +191,7 @@ func (o *rebuilder) rebuild(ctx context.Context) error { } func (o *rebuilder) cbAddedItem(ctx context.Context, tree btrfsprim.ObjID, key btrfsprim.Key) { - o.queue = append(o.queue, keyio.KeyAndTree{ + o.queue = append(o.queue, keyAndTree{ TreeID: tree, Key: key, }) |