diff options
Diffstat (limited to 'lib/btrfsprogs')
-rw-r--r-- | lib/btrfsprogs/btrfsinspect/mount.go | 3 | ||||
-rw-r--r-- | lib/btrfsprogs/btrfsinspect/print_tree.go | 3 | ||||
-rw-r--r-- | lib/btrfsprogs/btrfsinspect/recoverchunks.go | 4 | ||||
-rw-r--r-- | lib/btrfsprogs/btrfsrepair/clearnodes.go | 6 | ||||
-rw-r--r-- | lib/btrfsprogs/btrfsutil/broken_btree.go | 6 | ||||
-rw-r--r-- | lib/btrfsprogs/btrfsutil/scan.go | 4 |
6 files changed, 13 insertions, 13 deletions
diff --git a/lib/btrfsprogs/btrfsinspect/mount.go b/lib/btrfsprogs/btrfsinspect/mount.go index c882c65..05f3b9b 100644 --- a/lib/btrfsprogs/btrfsinspect/mount.go +++ b/lib/btrfsprogs/btrfsinspect/mount.go @@ -25,7 +25,6 @@ import ( "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsitem" "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsutil" "git.lukeshu.com/btrfs-progs-ng/lib/containers" - "git.lukeshu.com/btrfs-progs-ng/lib/linux" "git.lukeshu.com/btrfs-progs-ng/lib/maps" "git.lukeshu.com/btrfs-progs-ng/lib/slices" ) @@ -258,7 +257,7 @@ func (sv *subvolume) LookUpInode(_ context.Context, op *fuseops.LookUpInodeOp) e Child: 2, // an inode number that a real file will never have Attributes: fuseops.InodeAttributes{ Nlink: 1, - Mode: uint32(linux.ModeFmtDir | 0700), + Mode: uint32(btrfsitem.ModeFmtDir | 0700), }, } return nil diff --git a/lib/btrfsprogs/btrfsinspect/print_tree.go b/lib/btrfsprogs/btrfsinspect/print_tree.go index 8aef98a..960dcce 100644 --- a/lib/btrfsprogs/btrfsinspect/print_tree.go +++ b/lib/btrfsprogs/btrfsinspect/print_tree.go @@ -17,6 +17,7 @@ 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/diskio" "git.lukeshu.com/btrfs-progs-ng/lib/slices" "git.lukeshu.com/btrfs-progs-ng/lib/util" ) @@ -95,7 +96,7 @@ func DumpTrees(ctx context.Context, out io.Writer, fs *btrfs.FS) { func printTree(ctx context.Context, out io.Writer, fs *btrfs.FS, treeID btrfs.ObjID) { var itemOffset uint32 handlers := btrfs.TreeWalkHandler{ - Node: func(path btrfs.TreePath, nodeRef *util.Ref[btrfsvol.LogicalAddr, btrfs.Node]) error { + Node: func(path btrfs.TreePath, nodeRef *diskio.Ref[btrfsvol.LogicalAddr, btrfs.Node]) error { printHeaderInfo(out, nodeRef.Data) itemOffset = nodeRef.Data.Size - uint32(binstruct.StaticSize(btrfs.NodeHeader{})) return nil diff --git a/lib/btrfsprogs/btrfsinspect/recoverchunks.go b/lib/btrfsprogs/btrfsinspect/recoverchunks.go index 4f01d0a..27ac85b 100644 --- a/lib/btrfsprogs/btrfsinspect/recoverchunks.go +++ b/lib/btrfsprogs/btrfsinspect/recoverchunks.go @@ -14,8 +14,8 @@ import ( "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsitem" "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/diskio" "git.lukeshu.com/btrfs-progs-ng/lib/maps" - "git.lukeshu.com/btrfs-progs-ng/lib/util" ) type ScanOneDevResult struct { @@ -158,7 +158,7 @@ func ScanOneDev(ctx context.Context, dev *btrfs.Device, superblock btrfs.Superbl devSize, _ := dev.Size() lastProgress := -1 - err := btrfsutil.ScanForNodes(ctx, dev, superblock, func(nodeRef *util.Ref[btrfsvol.PhysicalAddr, btrfs.Node], err error) { + err := btrfsutil.ScanForNodes(ctx, dev, superblock, func(nodeRef *diskio.Ref[btrfsvol.PhysicalAddr, btrfs.Node], err error) { if err != nil { dlog.Infof(ctx, "... dev[%q] error: %v", dev.Name(), err) return diff --git a/lib/btrfsprogs/btrfsrepair/clearnodes.go b/lib/btrfsprogs/btrfsrepair/clearnodes.go index 9fa5a6a..9f1e42c 100644 --- a/lib/btrfsprogs/btrfsrepair/clearnodes.go +++ b/lib/btrfsprogs/btrfsrepair/clearnodes.go @@ -14,7 +14,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/util" + "git.lukeshu.com/btrfs-progs-ng/lib/diskio" ) func ClearBadNodes(ctx context.Context, fs *btrfs.FS) error { @@ -26,7 +26,7 @@ func ClearBadNodes(ctx context.Context, fs *btrfs.FS) error { dlog.Error(ctx, err) }, TreeWalkHandler: btrfs.TreeWalkHandler{ - Node: func(path btrfs.TreePath, node *util.Ref[btrfsvol.LogicalAddr, btrfs.Node]) error { + Node: func(path btrfs.TreePath, node *diskio.Ref[btrfsvol.LogicalAddr, btrfs.Node]) error { if !uuidsInited { metadataUUID = node.Data.Head.MetadataUUID chunkTreeUUID = node.Data.Head.ChunkTreeUUID @@ -34,7 +34,7 @@ func ClearBadNodes(ctx context.Context, fs *btrfs.FS) error { } return nil }, - BadNode: func(path btrfs.TreePath, node *util.Ref[btrfsvol.LogicalAddr, btrfs.Node], err error) error { + BadNode: func(path btrfs.TreePath, node *diskio.Ref[btrfsvol.LogicalAddr, btrfs.Node], err error) error { if !errors.Is(err, btrfs.ErrNotANode) { return err } diff --git a/lib/btrfsprogs/btrfsutil/broken_btree.go b/lib/btrfsprogs/btrfsutil/broken_btree.go index d2dc81c..6c97fcb 100644 --- a/lib/btrfsprogs/btrfsutil/broken_btree.go +++ b/lib/btrfsprogs/btrfsutil/broken_btree.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/containers" - "git.lukeshu.com/btrfs-progs-ng/lib/util" + "git.lukeshu.com/btrfs-progs-ng/lib/diskio" ) type indexItem struct { @@ -170,7 +170,7 @@ func (bt *brokenTrees) TreeSearchAll(treeID btrfs.ObjID, fn func(btrfs.Key) int) } ret := make([]btrfs.Item, len(indexItems)) - var node *util.Ref[btrfsvol.LogicalAddr, btrfs.Node] + var node *diskio.Ref[btrfsvol.LogicalAddr, btrfs.Node] for i := range indexItems { if node == nil || node.Addr != indexItems[i].Path.Node(-2).NodeAddr { var err error @@ -195,7 +195,7 @@ func (bt *brokenTrees) TreeWalk(ctx context.Context, treeID btrfs.ObjID, errHand }) return } - var node *util.Ref[btrfsvol.LogicalAddr, btrfs.Node] + var node *diskio.Ref[btrfsvol.LogicalAddr, btrfs.Node] _ = index.Walk(func(indexItem *containers.RBNode[indexItem]) error { if ctx.Err() != nil { return ctx.Err() diff --git a/lib/btrfsprogs/btrfsutil/scan.go b/lib/btrfsprogs/btrfsutil/scan.go index 7189e99..dd77747 100644 --- a/lib/btrfsprogs/btrfsutil/scan.go +++ b/lib/btrfsprogs/btrfsutil/scan.go @@ -11,15 +11,15 @@ 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/diskio" "git.lukeshu.com/btrfs-progs-ng/lib/slices" - "git.lukeshu.com/btrfs-progs-ng/lib/util" ) // ScanForNodes mimics btrfs-progs // cmds/rescue-chunk-recover.c:scan_one_device(), except rather than // doing something itself when it finds a node, it simply calls a // callback function. -func ScanForNodes(ctx context.Context, dev *btrfs.Device, sb btrfs.Superblock, fn func(*util.Ref[btrfsvol.PhysicalAddr, btrfs.Node], error), prog func(btrfsvol.PhysicalAddr)) error { +func ScanForNodes(ctx context.Context, dev *btrfs.Device, sb btrfs.Superblock, fn func(*diskio.Ref[btrfsvol.PhysicalAddr, btrfs.Node], error), prog func(btrfsvol.PhysicalAddr)) error { devSize, err := dev.Size() if err != nil { return err |