diff options
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/btrfs/io2_fs.go | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/pkg/btrfs/io2_fs.go b/pkg/btrfs/io2_fs.go index c86f806..dea8537 100644 --- a/pkg/btrfs/io2_fs.go +++ b/pkg/btrfs/io2_fs.go @@ -125,20 +125,10 @@ func (fs *FS) Init() error { return fmt.Errorf("file %q: %w", dev.Name(), err) } for _, chunk := range syschunks { - dbgf("a\n") fs.chunks = append(fs.chunks, chunk) } - dbgf("b\n") if err := fs.WalkTree(sb.Data.ChunkTree, WalkTreeHandler{ - Node: func(node *util.Ref[LogicalAddr, Node], err error) error { - dbgf("c\n") - if node != nil { - dbgf("DBG: init: node=%#v\n", node.Data) - } - return err - }, Item: func(key Key, body btrfsitem.Item) error { - dbgf("d\n") if key.ItemType != btrfsitem.CHUNK_ITEM_KEY { return nil } @@ -160,28 +150,12 @@ type QualifiedPhysicalAddr struct { Addr PhysicalAddr } -var Dbg = false - -func dbgf(format string, a ...any) { - if Dbg { - fmt.Printf(format, a...) - } -} - func (fs *FS) Resolve(laddr LogicalAddr) (paddrs map[QualifiedPhysicalAddr]struct{}, maxlen uint64) { paddrs = make(map[QualifiedPhysicalAddr]struct{}) maxlen = math.MaxUint64 - dbgf("DBG: resolving 0x%0x\n", laddr) - for i, chunk := range fs.chunks { - dbgf("DBG: chunk %d: 0x%0x <= 0x%0x < 0x%0x (%d stripes) ==> ", - i, - chunk.Key.Offset, - uint64(laddr), - chunk.Key.Offset+uint64(chunk.Chunk.Head.Size), - len(chunk.Chunk.Stripes)) + for _, chunk := range fs.chunks { if chunk.Key.Offset <= uint64(laddr) && uint64(laddr) < chunk.Key.Offset+uint64(chunk.Chunk.Head.Size) { - dbgf("true\n") offsetWithinChunk := uint64(laddr) - chunk.Key.Offset maxlen = util.Min(maxlen, chunk.Chunk.Head.Size-offsetWithinChunk) for _, stripe := range chunk.Chunk.Stripes { @@ -190,8 +164,6 @@ func (fs *FS) Resolve(laddr LogicalAddr) (paddrs map[QualifiedPhysicalAddr]struc Addr: stripe.Offset + PhysicalAddr(offsetWithinChunk), }] = struct{}{} } - } else { - dbgf("false\n") } } |