diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-05-24 21:53:28 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-05-24 21:53:28 -0600 |
commit | 23ab1f8be6a1f4b5ce01e05f8ed3f6b5dae30d0b (patch) | |
tree | 854801aa60dd204cd390c40f7cafb326e981014f /cmd/btrfs-dbg | |
parent | b0dd4d1f0c8262e3680570d529d00c9ebead1a91 (diff) |
stuff
Diffstat (limited to 'cmd/btrfs-dbg')
-rw-r--r-- | cmd/btrfs-dbg/main.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cmd/btrfs-dbg/main.go b/cmd/btrfs-dbg/main.go index 6d60a73..1b3b993 100644 --- a/cmd/btrfs-dbg/main.go +++ b/cmd/btrfs-dbg/main.go @@ -27,14 +27,18 @@ func Main(imgfilename string) (err error) { if err != nil { return err } - img := &btrfs.Img{ - File: fh, - } defer func() { - maybeSetErr(img.Close()) + maybeSetErr(fh.Close()) }() + fs := &btrfs.FS{ + Devices: []*btrfs.Device{ + { + File: fh, + }, + }, + } - superblocks, err := img.Superblocks() + superblocks, err := fs.Devices[0].Superblocks() if err != nil { return err } @@ -55,7 +59,7 @@ func Main(imgfilename string) (err error) { } spew.Dump(syschunks) - if err := img.ScanForNodes(superblocks[0].Data); err != nil { + if err := btrfs.ScanForNodes(fs.Devices[0], superblocks[0].Data); err != nil { return err } |