diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-06-26 19:55:49 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-06-26 19:55:49 -0600 |
commit | 502cdc72771de93ce41e2a00bc201fc488603f59 (patch) | |
tree | d8b7bc9890d0f8f8069c70376220ab54daae52f7 /cmd/btrfs-dbg/main.go | |
parent | e6b7c243462b1412390d0048dafe3430d07c05be (diff) |
better volume!
Diffstat (limited to 'cmd/btrfs-dbg/main.go')
-rw-r--r-- | cmd/btrfs-dbg/main.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cmd/btrfs-dbg/main.go b/cmd/btrfs-dbg/main.go index 62b005c..3f30915 100644 --- a/cmd/btrfs-dbg/main.go +++ b/cmd/btrfs-dbg/main.go @@ -32,15 +32,15 @@ func Main(imgfilename string) (err error) { defer func() { maybeSetErr(fh.Close()) }() - fs := &btrfs.FS{ - Devices: []*btrfs.Device{ - { - File: fh, - }, - }, + dev := &btrfs.Device{ + File: fh, + } + fs := new(btrfs.FS) + if err := fs.AddDevice(dev); err != nil { + return err } - superblocks, err := fs.Devices[0].Superblocks() + superblocks, err := fs.Superblocks() if err != nil { return err } @@ -61,7 +61,7 @@ func Main(imgfilename string) (err error) { } spew.Dump(syschunks) - if err := btrfsmisc.ScanForNodes(fs.Devices[0], superblocks[0].Data, func(nodeRef *util.Ref[btrfs.PhysicalAddr, btrfs.Node], err error) { + if err := btrfsmisc.ScanForNodes(dev, superblocks[0].Data, func(nodeRef *util.Ref[btrfs.PhysicalAddr, btrfs.Node], err error) { if err != nil { fmt.Println(err) } else { |