diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-12 15:17:39 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-14 19:45:07 -0600 |
commit | 1be85fecedebe9ea37b910a15a5c45dd2e57649d (patch) | |
tree | f9d4b2e0bf80e96175f789543cb9b2ac27f1484b /cmd | |
parent | 8c8c6c27552f8554ba014c34d684cb90538ef65b (diff) |
Get it to compile with the renamed files
#!/bin/bash
set -e
git ls-files :*.go :!tools/| while read -r file; do
pkgname=${file%/*.go}
pkgname=${pkgname##*/}
if [[ "$pkgname" == btrfs-rec ]]; then
pkgname=main
fi
sed -i "s/^package [^_]*/package ${pkgname}/" "$file"
done
# btrfsutil ####################################################################
gofmt -w -r 'rebuildnodes -> rebuildtrees' cmd lib
gofmt -w -r 'btrees -> btrfsutil' cmd lib
gofmt -w -r 'keyio -> btrfsutil' cmd lib
sed -i 's/func New/func NewGraph/' lib/btrfsutil/graph.go
gofmt -w -r 'graph.New -> btrfsutil.NewGraph' cmd lib
gofmt -w -r 'graph.Graph -> btrfsutil.Graph' cmd lib
sed -i -e '/\/graph"/d' -e 's/pkggraph\.//' lib/btrfsutil/rebuilt_forrest.go
gofmt -w -r 'btrfsutil.BrokenForrest -> BrokenForrest ' lib/btrfsutil
gofmt -w -r 'btrfsutil.Handle -> Handle ' lib/btrfsutil
gofmt -w -r 'btrfsutil.Graph -> Graph ' lib/btrfsutil
gofmt -w -r 'btrfsutil.ItemPtr -> ItemPtr ' lib/btrfsutil
gofmt -w -r 'Handle -> KeyIO' lib/btrfsutil
gofmt -w -r 'btrfsutil.Handle -> btrfsutil.KeyIO' cmd/btrfs-rec/inspect/rebuildtrees/
gofmt -w -r 'NewHandle -> NewKeyIO' cmd lib
# rebuildmappings ##############################################################
gofmt -w -r 'btrfsinspect.DumpTrees -> dumptrees.DumpTrees' cmd lib
gofmt -w -r 'btrfsinspect.MountRO -> mount.MountRO' cmd lib
gofmt -w -r 'btrfsinspect.ScanDevices -> rebuildmappings.ScanDevices' cmd lib
gofmt -w -r 'btrfsinspect.ScanDevicesResult -> rebuildmappings.ScanDevicesResult' cmd lib
gofmt -w -r 'btrfsinspect.SysExtentCSum -> rebuildmappings.SysExtentCSum' cmd lib
gofmt -w -r 'rebuildmappings.IndexAll -> IndexAll ' cmd/btrfs-rec/inspect/rebuildmappings
gofmt -w -r 'rebuildmappings.ScanDevicesResult -> ScanDevicesResult ' cmd/btrfs-rec/inspect/rebuildmappings
gofmt -w -r 'rebuildmappings.SysExtentCSum -> SysExtentCSum ' cmd/btrfs-rec/inspect/rebuildmappings
# btrfscheck ###################################################################
sed -i -e 's/func handle/func Handle/' lib/btrfscheck/graph.go
sed -i 's/handle/btrfscheck.Handle/g' cmd/btrfs-rec/inspect/rebuildtrees/rebuild.go
gofmt -w -r 'fsErr -> FSErr ' lib/btrfscheck cmd/btrfs-rec/inspect/rebuildtrees
gofmt -w -r 'want -> Want ' lib/btrfscheck cmd/btrfs-rec/inspect/rebuildtrees
gofmt -w -r 'wantOff -> WantOff ' lib/btrfscheck cmd/btrfs-rec/inspect/rebuildtrees
gofmt -w -r 'wantDirIndex -> WantDirIndex ' lib/btrfscheck cmd/btrfs-rec/inspect/rebuildtrees
gofmt -w -r 'wantCSum -> WantCSum ' lib/btrfscheck cmd/btrfs-rec/inspect/rebuildtrees
gofmt -w -r 'wantFileExt -> WantFileExt ' lib/btrfscheck cmd/btrfs-rec/inspect/rebuildtrees
# generic imports ##############################################################
replace() {
git grep -l "$1"|xargs -r sed -i "s,$1,$2,g"
}
replace 'lib/btrfsprogs/btrfsinspect/rebuildmappings"' 'cmd/btrfs-rec/inspect/rebuildmappings"'
replace 'lib/btrfsprogs/btrfsinspect/rebuildnodes"' 'cmd/btrfs-rec/inspect/rebuildtrees"'
replace 'lib/btrfsprogs/btrfsutil"' 'lib/btrfsutil"'
goimports -w cmd lib
./tools/bin/golangci-lint run --fix ./...
And then touch-up copyright statements by hand.
Diffstat (limited to 'cmd')
22 files changed, 90 insertions, 97 deletions
diff --git a/cmd/btrfs-rec/inspect/dumptrees/print_tree.go b/cmd/btrfs-rec/inspect/dumptrees/print_tree.go index 240c72f..676306a 100644 --- a/cmd/btrfs-rec/inspect/dumptrees/print_tree.go +++ b/cmd/btrfs-rec/inspect/dumptrees/print_tree.go @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-2.0-or-later -package btrfsinspect +package dumptrees import ( "context" diff --git a/cmd/btrfs-rec/inspect/mount/mount.go b/cmd/btrfs-rec/inspect/mount/mount.go index 0ac8497..7e68ae6 100644 --- a/cmd/btrfs-rec/inspect/mount/mount.go +++ b/cmd/btrfs-rec/inspect/mount/mount.go @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-2.0-or-later -package btrfsinspect +package mount import ( "context" @@ -25,7 +25,7 @@ import ( "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" "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/btrfsprogs/btrfsutil" + "git.lukeshu.com/btrfs-progs-ng/lib/btrfsutil" "git.lukeshu.com/btrfs-progs-ng/lib/containers" "git.lukeshu.com/btrfs-progs-ng/lib/maps" "git.lukeshu.com/btrfs-progs-ng/lib/slices" diff --git a/cmd/btrfs-rec/inspect/rebuildmappings/process.go b/cmd/btrfs-rec/inspect/rebuildmappings/process.go index cdf5e5a..5f41f15 100644 --- a/cmd/btrfs-rec/inspect/rebuildmappings/process.go +++ b/cmd/btrfs-rec/inspect/rebuildmappings/process.go @@ -12,7 +12,6 @@ import ( "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsvol" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect" "git.lukeshu.com/btrfs-progs-ng/lib/containers" "git.lukeshu.com/btrfs-progs-ng/lib/maps" "git.lukeshu.com/btrfs-progs-ng/lib/textui" @@ -26,7 +25,7 @@ func getNodeSize(fs *btrfs.FS) (btrfsvol.AddrDelta, error) { return btrfsvol.AddrDelta(sb.NodeSize), nil } -func RebuildMappings(ctx context.Context, fs *btrfs.FS, scanResults btrfsinspect.ScanDevicesResult) error { +func RebuildMappings(ctx context.Context, fs *btrfs.FS, scanResults ScanDevicesResult) error { nodeSize, err := getNodeSize(fs) if err != nil { return err diff --git a/cmd/btrfs-rec/inspect/rebuildmappings/process_blockgroups.go b/cmd/btrfs-rec/inspect/rebuildmappings/process_blockgroups.go index 0e2d5a0..f8d2337 100644 --- a/cmd/btrfs-rec/inspect/rebuildmappings/process_blockgroups.go +++ b/cmd/btrfs-rec/inspect/rebuildmappings/process_blockgroups.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 @@ -9,7 +9,6 @@ import ( "sort" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsvol" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect" "git.lukeshu.com/btrfs-progs-ng/lib/containers" "git.lukeshu.com/btrfs-progs-ng/lib/maps" ) @@ -20,7 +19,7 @@ type BlockGroup struct { Flags btrfsvol.BlockGroupFlags } -func DedupBlockGroups(scanResults btrfsinspect.ScanDevicesResult) (map[btrfsvol.LogicalAddr]BlockGroup, error) { +func DedupBlockGroups(scanResults ScanDevicesResult) (map[btrfsvol.LogicalAddr]BlockGroup, error) { // Dedup bgsSet := make(containers.Set[BlockGroup]) for _, devResults := range scanResults { diff --git a/cmd/btrfs-rec/inspect/rebuildmappings/process_sums_logical.go b/cmd/btrfs-rec/inspect/rebuildmappings/process_sums_logical.go index 7c02d05..2cdabb7 100644 --- a/cmd/btrfs-rec/inspect/rebuildmappings/process_sums_logical.go +++ b/cmd/btrfs-rec/inspect/rebuildmappings/process_sums_logical.go @@ -15,13 +15,12 @@ import ( "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsitem" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfssum" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsvol" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect" "git.lukeshu.com/btrfs-progs-ng/lib/containers" "git.lukeshu.com/btrfs-progs-ng/lib/slices" ) -func ExtractLogicalSums(ctx context.Context, scanResults btrfsinspect.ScanDevicesResult) SumRunWithGaps[btrfsvol.LogicalAddr] { - var records []btrfsinspect.SysExtentCSum +func ExtractLogicalSums(ctx context.Context, scanResults ScanDevicesResult) SumRunWithGaps[btrfsvol.LogicalAddr] { + var records []SysExtentCSum for _, devResults := range scanResults { records = append(records, devResults.FoundExtentCSums...) } @@ -53,10 +52,10 @@ func ExtractLogicalSums(ctx context.Context, scanResults btrfsinspect.ScanDevice // "AAAAAAA" shouldn't be present, and if we just discard "BBBBBBBB" // because it conflicts with "CCCCCCC", then we would erroneously // include "AAAAAAA". - addrspace := new(containers.RBTree[btrfsinspect.SysExtentCSum]) + addrspace := new(containers.RBTree[SysExtentCSum]) for _, newRecord := range records { for { - conflict := addrspace.Search(func(oldRecord btrfsinspect.SysExtentCSum) int { + conflict := addrspace.Search(func(oldRecord SysExtentCSum) int { switch { case newRecord.Sums.Addr.Add(newRecord.Sums.Size()) <= oldRecord.Sums.Addr: // 'newRecord' is wholly to the left of 'oldRecord'. @@ -128,7 +127,7 @@ func ExtractLogicalSums(ctx context.Context, scanResults btrfsinspect.ScanDevice case newRecord.Sums.Addr.Add(newRecord.Sums.Size()) > overlapEnd: suffix = newRecord.Sums.Sums[newOverlapEnd:] } - unionRecord := btrfsinspect.SysExtentCSum{ + unionRecord := SysExtentCSum{ Generation: oldRecord.Generation, Sums: btrfsitem.ExtentCSum{ SumRun: btrfssum.SumRun[btrfsvol.LogicalAddr]{ @@ -148,7 +147,7 @@ func ExtractLogicalSums(ctx context.Context, scanResults btrfsinspect.ScanDevice var flattened SumRunWithGaps[btrfsvol.LogicalAddr] var curAddr btrfsvol.LogicalAddr var curSums strings.Builder - addrspace.Range(func(node *containers.RBNode[btrfsinspect.SysExtentCSum]) bool { + addrspace.Range(func(node *containers.RBNode[SysExtentCSum]) bool { curEnd := curAddr + (btrfsvol.LogicalAddr(curSums.Len()/sumSize) * btrfssum.BlockSize) if node.Value.Sums.Addr != curEnd { if curSums.Len() > 0 { diff --git a/cmd/btrfs-rec/inspect/rebuildmappings/process_sums_physical.go b/cmd/btrfs-rec/inspect/rebuildmappings/process_sums_physical.go index da22fbf..392ded9 100644 --- a/cmd/btrfs-rec/inspect/rebuildmappings/process_sums_physical.go +++ b/cmd/btrfs-rec/inspect/rebuildmappings/process_sums_physical.go @@ -13,11 +13,10 @@ import ( "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfssum" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsvol" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect" "git.lukeshu.com/btrfs-progs-ng/lib/maps" ) -func ExtractPhysicalSums(scanResults btrfsinspect.ScanDevicesResult) map[btrfsvol.DeviceID]btrfssum.SumRun[btrfsvol.PhysicalAddr] { +func ExtractPhysicalSums(scanResults ScanDevicesResult) map[btrfsvol.DeviceID]btrfssum.SumRun[btrfsvol.PhysicalAddr] { ret := make(map[btrfsvol.DeviceID]btrfssum.SumRun[btrfsvol.PhysicalAddr], len(scanResults)) for devID, devResults := range scanResults { ret[devID] = devResults.Checksums diff --git a/cmd/btrfs-rec/inspect/rebuildmappings/scan.go b/cmd/btrfs-rec/inspect/rebuildmappings/scan.go index d54be71..b67beaf 100644 --- a/cmd/btrfs-rec/inspect/rebuildmappings/scan.go +++ b/cmd/btrfs-rec/inspect/rebuildmappings/scan.go @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-2.0-or-later -package btrfsinspect +package rebuildmappings import ( "context" diff --git a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild.go b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild.go index cf334a0..6492d9c 100644 --- a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild.go +++ b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild.go @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-2.0-or-later -package rebuildnodes +package rebuildtrees import ( "context" @@ -14,15 +14,14 @@ import ( "github.com/datawire/dlib/dgroup" "github.com/datawire/dlib/dlog" + "git.lukeshu.com/btrfs-progs-ng/cmd/btrfs-rec/inspect/rebuildmappings" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" "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" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect/rebuildnodes/btrees" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect/rebuildnodes/graph" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect/rebuildnodes/keyio" + "git.lukeshu.com/btrfs-progs-ng/lib/btrfscheck" + "git.lukeshu.com/btrfs-progs-ng/lib/btrfsutil" "git.lukeshu.com/btrfs-progs-ng/lib/containers" "git.lukeshu.com/btrfs-progs-ng/lib/maps" "git.lukeshu.com/btrfs-progs-ng/lib/textui" @@ -46,10 +45,10 @@ func (o keyAndTree) String() string { type rebuilder struct { sb btrfstree.Superblock - graph graph.Graph - keyIO *keyio.Handle + graph btrfsutil.Graph + keyIO *btrfsutil.KeyIO - rebuilt *btrees.RebuiltForrest + rebuilt *btrfsutil.RebuiltForrest curKey struct { TreeID btrfsprim.ObjID @@ -75,7 +74,7 @@ type Rebuilder interface { ListRoots(context.Context) map[btrfsprim.ObjID]containers.Set[btrfsvol.LogicalAddr] } -func NewRebuilder(ctx context.Context, fs *btrfs.FS, nodeScanResults btrfsinspect.ScanDevicesResult) (Rebuilder, error) { +func NewRebuilder(ctx context.Context, fs *btrfs.FS, nodeScanResults rebuildmappings.ScanDevicesResult) (Rebuilder, error) { ctx = dlog.WithField(ctx, "btrfsinspect.rebuild-nodes.step", "read-fs-data") sb, nodeGraph, keyIO, err := ScanDevices(ctx, fs, nodeScanResults) // ScanDevices does its own logging if err != nil { @@ -87,7 +86,7 @@ func NewRebuilder(ctx context.Context, fs *btrfs.FS, nodeScanResults btrfsinspec graph: nodeGraph, keyIO: keyIO, } - o.rebuilt = btrees.NewRebuiltForrest(sb, nodeGraph, keyIO, o) + o.rebuilt = btrfsutil.NewRebuiltForrest(sb, nodeGraph, keyIO, o) return o, nil } @@ -214,7 +213,7 @@ func (o *rebuilder) processAddedItemQueue(ctx context.Context) error { progress.NumAugments = o.numAugments progress.NumAugmentTrees = len(o.augmentQueue) progressWriter.Set(progress) - } else if !handleWouldBeNoOp(key.ItemType) { + } else if !btrfscheck.HandleWouldBeNoOp(key.ItemType) { o.settledItemQueue.Insert(key) } } @@ -284,7 +283,7 @@ func (o *rebuilder) processSettledItemQueue(ctx context.Context) error { ctx := dlog.WithField(ctx, "btrfsinspect.rebuild-nodes.rebuild.process.item", item.keyAndTree) o.curKey.TreeID = item.TreeID o.curKey.Key.Val = item.Key - handleItem(o, ctx, item.TreeID, btrfstree.Item{ + btrfscheck.HandleItem(o, ctx, item.TreeID, btrfstree.Item{ Key: item.Key, Body: item.Body, }) diff --git a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go index 492436b..d58689c 100644 --- a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go +++ b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_treecb.go @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-2.0-or-later -package rebuildnodes +package rebuildtrees import ( "context" @@ -50,7 +50,7 @@ func (o *rebuilder) LookupRoot(ctx context.Context, tree btrfsprim.ObjID) (offse case *btrfsitem.Root: return btrfsprim.Generation(foundKey.Offset), *itemBody, true case *btrfsitem.Error: - o.fsErr(ctx, fmt.Errorf("error decoding item: %v: %w", foundKey, itemBody.Err)) + o.FSErr(ctx, fmt.Errorf("error decoding item: %v: %w", foundKey, itemBody.Err)) return 0, btrfsitem.Root{}, false default: // This is a panic because the item decoder should not emit ROOT_ITEM items as anything but @@ -76,7 +76,7 @@ func (o *rebuilder) LookupUUID(ctx context.Context, uuid btrfsprim.UUID) (id btr case *btrfsitem.UUIDMap: return itemBody.ObjID, true case *btrfsitem.Error: - o.fsErr(ctx, fmt.Errorf("error decoding item: %v: %w", wantKey, itemBody.Err)) + o.FSErr(ctx, fmt.Errorf("error decoding item: %v: %w", wantKey, itemBody.Err)) return 0, false default: // This is a panic because the item decoder should not emit UUID_SUBVOL items as anything but diff --git a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go index adf3cff..06be630 100644 --- a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go +++ b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wantcb.go @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-2.0-or-later -package rebuildnodes +package rebuildtrees import ( "bytes" @@ -15,17 +15,17 @@ import ( "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsprim" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfssum" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsvol" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect/rebuildnodes/keyio" + "git.lukeshu.com/btrfs-progs-ng/lib/btrfsutil" "git.lukeshu.com/btrfs-progs-ng/lib/containers" ) // fsErr implements rebuildCallbacks. -func (o *rebuilder) fsErr(ctx context.Context, e error) { +func (o *rebuilder) FSErr(ctx context.Context, e error) { dlog.Errorf(ctx, "filesystem error: %v", e) } // want implements rebuildCallbacks. -func (o *rebuilder) want(ctx context.Context, reason string, treeID btrfsprim.ObjID, objID btrfsprim.ObjID, typ btrfsprim.ItemType) { +func (o *rebuilder) Want(ctx context.Context, reason string, treeID btrfsprim.ObjID, objID btrfsprim.ObjID, typ btrfsprim.ItemType) { wantKey := WantWithTree{ TreeID: treeID, Key: Want{ @@ -47,7 +47,7 @@ func (o *rebuilder) _want(ctx context.Context, wantKey WantWithTree) (key btrfsp // check if we already have it tgt := wantKey.Key.Key() - if key, _, ok := o.rebuilt.Tree(ctx, wantKey.TreeID).Items(ctx).Search(func(key btrfsprim.Key, _ keyio.ItemPtr) int { + if key, _, ok := o.rebuilt.Tree(ctx, wantKey.TreeID).Items(ctx).Search(func(key btrfsprim.Key, _ btrfsutil.ItemPtr) int { key.Offset = 0 return tgt.Compare(key) }); ok { @@ -61,11 +61,11 @@ func (o *rebuilder) _want(ctx context.Context, wantKey WantWithTree) (key btrfsp } wants := make(containers.Set[btrfsvol.LogicalAddr]) o.rebuilt.Tree(ctx, wantKey.TreeID).PotentialItems(ctx).Subrange( - func(k btrfsprim.Key, _ keyio.ItemPtr) int { + func(k btrfsprim.Key, _ btrfsutil.ItemPtr) int { k.Offset = 0 return tgt.Compare(k) }, - func(_ btrfsprim.Key, v keyio.ItemPtr) bool { + func(_ btrfsprim.Key, v btrfsutil.ItemPtr) bool { wants.InsertFrom(o.rebuilt.Tree(ctx, wantKey.TreeID).LeafToRoots(ctx, v.Node)) return true }) @@ -74,7 +74,7 @@ func (o *rebuilder) _want(ctx context.Context, wantKey WantWithTree) (key btrfsp } // wantOff implements rebuildCallbacks. -func (o *rebuilder) wantOff(ctx context.Context, reason string, treeID btrfsprim.ObjID, objID btrfsprim.ObjID, typ btrfsprim.ItemType, off uint64) { +func (o *rebuilder) WantOff(ctx context.Context, reason string, treeID btrfsprim.ObjID, objID btrfsprim.ObjID, typ btrfsprim.ItemType, off uint64) { wantKey := WantWithTree{ TreeID: treeID, Key: Want{ @@ -108,8 +108,8 @@ func (o *rebuilder) _wantOff(ctx context.Context, wantKey WantWithTree) (ok bool } wants := make(containers.Set[btrfsvol.LogicalAddr]) o.rebuilt.Tree(ctx, wantKey.TreeID).PotentialItems(ctx).Subrange( - func(k btrfsprim.Key, _ keyio.ItemPtr) int { return tgt.Compare(k) }, - func(_ btrfsprim.Key, v keyio.ItemPtr) bool { + func(k btrfsprim.Key, _ btrfsutil.ItemPtr) int { return tgt.Compare(k) }, + func(_ btrfsprim.Key, v btrfsutil.ItemPtr) bool { wants.InsertFrom(o.rebuilt.Tree(ctx, wantKey.TreeID).LeafToRoots(ctx, v.Node)) return true }) @@ -118,7 +118,7 @@ func (o *rebuilder) _wantOff(ctx context.Context, wantKey WantWithTree) (ok bool } // wantDirIndex implements rebuildCallbacks. -func (o *rebuilder) wantDirIndex(ctx context.Context, reason string, treeID btrfsprim.ObjID, objID btrfsprim.ObjID, name []byte) { +func (o *rebuilder) WantDirIndex(ctx context.Context, reason string, treeID btrfsprim.ObjID, objID btrfsprim.ObjID, name []byte) { wantKey := WantWithTree{ TreeID: treeID, Key: Want{ @@ -140,11 +140,11 @@ func (o *rebuilder) wantDirIndex(ctx context.Context, reason string, treeID btrf tgt := wantKey.Key.Key() found := false o.rebuilt.Tree(ctx, treeID).Items(ctx).Subrange( - func(key btrfsprim.Key, _ keyio.ItemPtr) int { + func(key btrfsprim.Key, _ btrfsutil.ItemPtr) int { key.Offset = 0 return tgt.Compare(key) }, - func(_ btrfsprim.Key, ptr keyio.ItemPtr) bool { + func(_ btrfsprim.Key, ptr btrfsutil.ItemPtr) bool { if itemName, ok := o.keyIO.Names[ptr]; ok && bytes.Equal(itemName, name) { found = true } @@ -161,11 +161,11 @@ func (o *rebuilder) wantDirIndex(ctx context.Context, reason string, treeID btrf } wants := make(containers.Set[btrfsvol.LogicalAddr]) o.rebuilt.Tree(ctx, treeID).PotentialItems(ctx).Subrange( - func(key btrfsprim.Key, _ keyio.ItemPtr) int { + func(key btrfsprim.Key, _ btrfsutil.ItemPtr) int { key.Offset = 0 return tgt.Compare(key) }, - func(_ btrfsprim.Key, ptr keyio.ItemPtr) bool { + func(_ btrfsprim.Key, ptr btrfsutil.ItemPtr) bool { if itemName, ok := o.keyIO.Names[ptr]; ok && bytes.Equal(itemName, name) { wants.InsertFrom(o.rebuilt.Tree(ctx, treeID).LeafToRoots(ctx, ptr.Node)) } @@ -176,10 +176,10 @@ func (o *rebuilder) wantDirIndex(ctx context.Context, reason string, treeID btrf func (o *rebuilder) _walkRange( ctx context.Context, - items *containers.SortedMap[btrfsprim.Key, keyio.ItemPtr], + items *containers.SortedMap[btrfsprim.Key, btrfsutil.ItemPtr], treeID, objID btrfsprim.ObjID, typ btrfsprim.ItemType, beg, end uint64, - fn func(key btrfsprim.Key, ptr keyio.ItemPtr, beg, end uint64), + fn func(key btrfsprim.Key, ptr btrfsutil.ItemPtr, beg, end uint64), ) { min := btrfsprim.Key{ ObjectID: objID, @@ -192,7 +192,7 @@ func (o *rebuilder) _walkRange( Offset: end - 1, } items.Subrange( - func(runKey btrfsprim.Key, _ keyio.ItemPtr) int { + func(runKey btrfsprim.Key, _ btrfsutil.ItemPtr) int { switch { case min.Compare(runKey) < 0: return 1 @@ -202,14 +202,14 @@ func (o *rebuilder) _walkRange( return 0 } }, - func(runKey btrfsprim.Key, runPtr keyio.ItemPtr) bool { + func(runKey btrfsprim.Key, runPtr btrfsutil.ItemPtr) bool { runSizeAndErr, ok := o.keyIO.Sizes[runPtr] if !ok { panic(fmt.Errorf("should not happen: %v (%v) did not have a size recorded", runPtr, keyAndTree{TreeID: treeID, Key: runKey})) } if runSizeAndErr.Err != nil { - o.fsErr(ctx, fmt.Errorf("get size: %v (%v): %w", + o.FSErr(ctx, fmt.Errorf("get size: %v (%v): %w", runPtr, keyAndTree{TreeID: treeID, Key: runKey}, runSizeAndErr.Err)) return true @@ -273,7 +273,7 @@ func (o *rebuilder) _wantRange( ctx, o.rebuilt.Tree(ctx, treeID).Items(ctx), treeID, objID, typ, beg, end, - func(runKey btrfsprim.Key, _ keyio.ItemPtr, runBeg, runEnd uint64) { + func(runKey btrfsprim.Key, _ btrfsutil.ItemPtr, runBeg, runEnd uint64) { var overlappingGaps []*containers.RBNode[gap] gaps.Subrange( func(gap gap) int { @@ -324,7 +324,7 @@ func (o *rebuilder) _wantRange( ctx, potentialItems, treeID, objID, typ, gap.Beg, gap.End, - func(k btrfsprim.Key, v keyio.ItemPtr, runBeg, runEnd uint64) { + func(k btrfsprim.Key, v btrfsutil.ItemPtr, runBeg, runEnd uint64) { // TODO: This is dumb and greedy. if last < runBeg { // log an error @@ -353,7 +353,7 @@ func (o *rebuilder) _wantRange( // func implements rebuildCallbacks. // // interval is [beg, end) -func (o *rebuilder) wantCSum(ctx context.Context, reason string, inodeTree, inode btrfsprim.ObjID, beg, end btrfsvol.LogicalAddr) { +func (o *rebuilder) WantCSum(ctx context.Context, reason string, inodeTree, inode btrfsprim.ObjID, beg, end btrfsvol.LogicalAddr) { inodeWant := WantWithTree{ TreeID: inodeTree, Key: Want{ @@ -377,7 +377,7 @@ func (o *rebuilder) wantCSum(ctx context.Context, reason string, inodeTree, inod panic(fmt.Errorf("should not happen: INODE_ITEM did not have flags recorded")) } if inodeFlags.Err != nil { - o.fsErr(inodeCtx, inodeFlags.Err) + o.FSErr(inodeCtx, inodeFlags.Err) return } @@ -392,7 +392,7 @@ func (o *rebuilder) wantCSum(ctx context.Context, reason string, inodeTree, inod } // wantFileExt implements rebuildCallbacks. -func (o *rebuilder) wantFileExt(ctx context.Context, reason string, treeID btrfsprim.ObjID, ino btrfsprim.ObjID, size int64) { +func (o *rebuilder) WantFileExt(ctx context.Context, reason string, treeID btrfsprim.ObjID, ino btrfsprim.ObjID, size int64) { o._wantRange( ctx, reason, treeID, ino, btrfsprim.EXTENT_DATA_KEY, diff --git a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wanttyp.go b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wanttyp.go index 2b471fe..fa1ba98 100644 --- a/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wanttyp.go +++ b/cmd/btrfs-rec/inspect/rebuildtrees/rebuild_wanttyp.go @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-2.0-or-later -package rebuildnodes +package rebuildtrees import ( "context" diff --git a/cmd/btrfs-rec/inspect/rebuildtrees/scan.go b/cmd/btrfs-rec/inspect/rebuildtrees/scan.go index 17949ab..03261e0 100644 --- a/cmd/btrfs-rec/inspect/rebuildtrees/scan.go +++ b/cmd/btrfs-rec/inspect/rebuildtrees/scan.go @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: GPL-2.0-or-later -package rebuildnodes +package rebuildtrees import ( "context" @@ -10,22 +10,21 @@ import ( "github.com/datawire/dlib/dlog" + "git.lukeshu.com/btrfs-progs-ng/cmd/btrfs-rec/inspect/rebuildmappings" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfstree" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsvol" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect/rebuildnodes/graph" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect/rebuildnodes/keyio" + "git.lukeshu.com/btrfs-progs-ng/lib/btrfsutil" "git.lukeshu.com/btrfs-progs-ng/lib/containers" "git.lukeshu.com/btrfs-progs-ng/lib/maps" "git.lukeshu.com/btrfs-progs-ng/lib/textui" ) -func ScanDevices(ctx context.Context, fs *btrfs.FS, scanResults btrfsinspect.ScanDevicesResult) (btrfstree.Superblock, graph.Graph, *keyio.Handle, error) { +func ScanDevices(ctx context.Context, fs *btrfs.FS, scanResults rebuildmappings.ScanDevicesResult) (btrfstree.Superblock, btrfsutil.Graph, *btrfsutil.KeyIO, error) { dlog.Info(ctx, "Reading superblock...") sb, err := fs.Superblock() if err != nil { - return btrfstree.Superblock{}, graph.Graph{}, nil, err + return btrfstree.Superblock{}, btrfsutil.Graph{}, nil, err } dlog.Infof(ctx, "Reading node data from FS...") @@ -36,21 +35,21 @@ func ScanDevices(ctx context.Context, fs *btrfs.FS, scanResults btrfsinspect.Sca dlog.WithField(ctx, "btrfsinspect.rebuild-nodes.read.substep", "read-nodes"), dlog.LogLevelInfo, textui.Tunable(1*time.Second)) - nodeGraph := graph.New(*sb) - keyIO := keyio.NewHandle(fs, *sb) + nodeGraph := btrfsutil.NewGraph(*sb) + keyIO := btrfsutil.NewKeyIO(fs, *sb) progressWriter.Set(stats) for _, devResults := range scanResults { for _, laddr := range maps.SortedKeys(devResults.FoundNodes) { if err := ctx.Err(); err != nil { - return btrfstree.Superblock{}, graph.Graph{}, nil, err + return btrfstree.Superblock{}, btrfsutil.Graph{}, nil, err } nodeRef, err := btrfstree.ReadNode[btrfsvol.LogicalAddr](fs, *sb, laddr, btrfstree.NodeExpectations{ LAddr: containers.Optional[btrfsvol.LogicalAddr]{OK: true, Val: laddr}, }) if err != nil { btrfstree.FreeNodeRef(nodeRef) - return btrfstree.Superblock{}, graph.Graph{}, nil, err + return btrfstree.Superblock{}, btrfsutil.Graph{}, nil, err } nodeGraph.InsertNode(nodeRef) @@ -69,7 +68,7 @@ func ScanDevices(ctx context.Context, fs *btrfs.FS, scanResults btrfsinspect.Sca dlog.Info(ctx, "... done reading node data") if err := nodeGraph.FinalCheck(ctx, fs, *sb); err != nil { - return btrfstree.Superblock{}, graph.Graph{}, nil, err + return btrfstree.Superblock{}, btrfsutil.Graph{}, nil, err } keyIO.SetGraph(*nodeGraph) diff --git a/cmd/btrfs-rec/inspect/rebuildtrees/util.go b/cmd/btrfs-rec/inspect/rebuildtrees/util.go index 9d91f23..71caee0 100644 --- a/cmd/btrfs-rec/inspect/rebuildtrees/util.go +++ b/cmd/btrfs-rec/inspect/rebuildtrees/util.go @@ -1,16 +1,16 @@ -// 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 -package rebuildnodes +package rebuildtrees import ( "golang.org/x/exp/constraints" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect" + "git.lukeshu.com/btrfs-progs-ng/cmd/btrfs-rec/inspect/rebuildmappings" ) -func countNodes(nodeScanResults btrfsinspect.ScanDevicesResult) int { +func countNodes(nodeScanResults rebuildmappings.ScanDevicesResult) int { var cnt int for _, devResults := range nodeScanResults { cnt += len(devResults.FoundNodes) diff --git a/cmd/btrfs-rec/inspect_dumptrees.go b/cmd/btrfs-rec/inspect_dumptrees.go index 4dc4bb2..efdc380 100644 --- a/cmd/btrfs-rec/inspect_dumptrees.go +++ b/cmd/btrfs-rec/inspect_dumptrees.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 @@ -10,8 +10,8 @@ import ( "github.com/datawire/ocibuild/pkg/cliutil" "github.com/spf13/cobra" + "git.lukeshu.com/btrfs-progs-ng/cmd/btrfs-rec/inspect/dumptrees" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect" "git.lukeshu.com/btrfs-progs-ng/lib/textui" ) @@ -26,7 +26,7 @@ func init() { const version = "6.1.3" out := os.Stdout textui.Fprintf(out, "btrfs-progs v%v\n", version) - btrfsinspect.DumpTrees(cmd.Context(), out, fs) + dumptrees.DumpTrees(cmd.Context(), out, fs) return nil }, }) diff --git a/cmd/btrfs-rec/inspect_lsfiles.go b/cmd/btrfs-rec/inspect_lsfiles.go index 7ecaaf0..d8da481 100644 --- a/cmd/btrfs-rec/inspect_lsfiles.go +++ b/cmd/btrfs-rec/inspect_lsfiles.go @@ -20,7 +20,7 @@ import ( "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" "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/btrfsprogs/btrfsutil" + "git.lukeshu.com/btrfs-progs-ng/lib/btrfsutil" "git.lukeshu.com/btrfs-progs-ng/lib/maps" "git.lukeshu.com/btrfs-progs-ng/lib/textui" ) diff --git a/cmd/btrfs-rec/inspect_lstrees.go b/cmd/btrfs-rec/inspect_lstrees.go index 69295f0..df2473c 100644 --- a/cmd/btrfs-rec/inspect_lstrees.go +++ b/cmd/btrfs-rec/inspect_lstrees.go @@ -12,13 +12,13 @@ import ( "github.com/datawire/ocibuild/pkg/cliutil" "github.com/spf13/cobra" + "git.lukeshu.com/btrfs-progs-ng/cmd/btrfs-rec/inspect/rebuildmappings" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" "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" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsutil" + "git.lukeshu.com/btrfs-progs-ng/lib/btrfsutil" "git.lukeshu.com/btrfs-progs-ng/lib/containers" "git.lukeshu.com/btrfs-progs-ng/lib/diskio" "git.lukeshu.com/btrfs-progs-ng/lib/maps" @@ -36,10 +36,10 @@ func init() { }, RunE: func(fs *btrfs.FS, cmd *cobra.Command, _ []string) error { ctx := cmd.Context() - var scanResults btrfsinspect.ScanDevicesResult + var scanResults rebuildmappings.ScanDevicesResult if scandevicesFilename != "" { var err error - scanResults, err = readJSONFile[btrfsinspect.ScanDevicesResult](ctx, scandevicesFilename) + scanResults, err = readJSONFile[rebuildmappings.ScanDevicesResult](ctx, scandevicesFilename) if err != nil { return err } diff --git a/cmd/btrfs-rec/inspect_mount.go b/cmd/btrfs-rec/inspect_mount.go index cff33b6..f3fda34 100644 --- a/cmd/btrfs-rec/inspect_mount.go +++ b/cmd/btrfs-rec/inspect_mount.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 @@ -8,8 +8,8 @@ import ( "github.com/datawire/ocibuild/pkg/cliutil" "github.com/spf13/cobra" + "git.lukeshu.com/btrfs-progs-ng/cmd/btrfs-rec/inspect/mount" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect" ) func init() { @@ -21,7 +21,7 @@ func init() { Args: cliutil.WrapPositionalArgs(cobra.ExactArgs(1)), }, RunE: func(fs *btrfs.FS, cmd *cobra.Command, args []string) error { - return btrfsinspect.MountRO(cmd.Context(), fs, args[0], skipFileSums) + return mount.MountRO(cmd.Context(), fs, args[0], skipFileSums) }, } cmd.Command.Flags().BoolVar(&skipFileSums, "skip-filesums", false, diff --git a/cmd/btrfs-rec/inspect_rebuildmappings.go b/cmd/btrfs-rec/inspect_rebuildmappings.go index 51f0327..005fd5d 100644 --- a/cmd/btrfs-rec/inspect_rebuildmappings.go +++ b/cmd/btrfs-rec/inspect_rebuildmappings.go @@ -12,9 +12,8 @@ import ( "github.com/datawire/ocibuild/pkg/cliutil" "github.com/spf13/cobra" + "git.lukeshu.com/btrfs-progs-ng/cmd/btrfs-rec/inspect/rebuildmappings" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect/rebuildmappings" ) func init() { @@ -36,7 +35,7 @@ func init() { ctx := cmd.Context() dlog.Infof(ctx, "Reading %q...", args[0]) - scanResults, err := readJSONFile[btrfsinspect.ScanDevicesResult](ctx, args[0]) + scanResults, err := readJSONFile[rebuildmappings.ScanDevicesResult](ctx, args[0]) if err != nil { return err } diff --git a/cmd/btrfs-rec/inspect_rebuildtrees.go b/cmd/btrfs-rec/inspect_rebuildtrees.go index ba1dcab..0b41dd9 100644 --- a/cmd/btrfs-rec/inspect_rebuildtrees.go +++ b/cmd/btrfs-rec/inspect_rebuildtrees.go @@ -15,9 +15,9 @@ import ( "github.com/datawire/ocibuild/pkg/cliutil" "github.com/spf13/cobra" + "git.lukeshu.com/btrfs-progs-ng/cmd/btrfs-rec/inspect/rebuildmappings" + "git.lukeshu.com/btrfs-progs-ng/cmd/btrfs-rec/inspect/rebuildtrees" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect/rebuildnodes" "git.lukeshu.com/btrfs-progs-ng/lib/textui" ) @@ -32,15 +32,15 @@ func init() { // This is wrapped in a func in order to *ensure* that `nodeScanResults` goes out of scope once // `rebuilder` has been created. - rebuilder, err := func(ctx context.Context) (rebuildnodes.Rebuilder, error) { + rebuilder, err := func(ctx context.Context) (rebuildtrees.Rebuilder, error) { dlog.Infof(ctx, "Reading %q...", args[0]) - nodeScanResults, err := readJSONFile[btrfsinspect.ScanDevicesResult](ctx, args[0]) + nodeScanResults, err := readJSONFile[rebuildmappings.ScanDevicesResult](ctx, args[0]) if err != nil { return nil, err } dlog.Infof(ctx, "... done reading %q", args[0]) - return rebuildnodes.NewRebuilder(ctx, fs, nodeScanResults) + return rebuildtrees.NewRebuilder(ctx, fs, nodeScanResults) }(ctx) if err != nil { return err diff --git a/cmd/btrfs-rec/inspect_scandevices.go b/cmd/btrfs-rec/inspect_scandevices.go index 3de35d0..0542d6a 100644 --- a/cmd/btrfs-rec/inspect_scandevices.go +++ b/cmd/btrfs-rec/inspect_scandevices.go @@ -12,8 +12,8 @@ import ( "github.com/datawire/ocibuild/pkg/cliutil" "github.com/spf13/cobra" + "git.lukeshu.com/btrfs-progs-ng/cmd/btrfs-rec/inspect/rebuildmappings" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsinspect" ) func init() { @@ -25,7 +25,7 @@ func init() { RunE: func(fs *btrfs.FS, cmd *cobra.Command, _ []string) (err error) { ctx := cmd.Context() - results, err := btrfsinspect.ScanDevices(ctx, fs) + results, err := rebuildmappings.ScanDevices(ctx, fs) if err != nil { return err } diff --git a/cmd/btrfs-rec/inspect_spewitems.go b/cmd/btrfs-rec/inspect_spewitems.go index 3b79e8b..4abb2b0 100644 --- a/cmd/btrfs-rec/inspect_spewitems.go +++ b/cmd/btrfs-rec/inspect_spewitems.go @@ -14,7 +14,7 @@ import ( "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfstree" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsutil" + "git.lukeshu.com/btrfs-progs-ng/lib/btrfsutil" "git.lukeshu.com/btrfs-progs-ng/lib/textui" ) diff --git a/cmd/btrfs-rec/main.go b/cmd/btrfs-rec/main.go index dc00dab..bf89fbc 100644 --- a/cmd/btrfs-rec/main.go +++ b/cmd/btrfs-rec/main.go @@ -15,7 +15,7 @@ import ( "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsvol" - "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsutil" + "git.lukeshu.com/btrfs-progs-ng/lib/btrfsutil" "git.lukeshu.com/btrfs-progs-ng/lib/profile" "git.lukeshu.com/btrfs-progs-ng/lib/textui" ) |