diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-08-28 17:55:36 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-08-28 18:09:10 -0600 |
commit | e2cdb05eac6726c59fe1831876fddd8037156d67 (patch) | |
tree | 157e86b1088710e4f7b93ea8dc8c08c32eeb70ef /lib/btrfs/io1_pv.go | |
parent | a2743121bad8a390dd248e3ec5c8d6844876832a (diff) |
btrfs: Split off btrfstree and btrfsprim sub-packages
Diffstat (limited to 'lib/btrfs/io1_pv.go')
-rw-r--r-- | lib/btrfs/io1_pv.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/btrfs/io1_pv.go b/lib/btrfs/io1_pv.go index df31671..0e7cd9c 100644 --- a/lib/btrfs/io1_pv.go +++ b/lib/btrfs/io1_pv.go @@ -8,6 +8,7 @@ import ( "fmt" "git.lukeshu.com/btrfs-progs-ng/lib/binstruct" + "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/diskio" ) @@ -15,8 +16,8 @@ import ( type Device struct { diskio.File[btrfsvol.PhysicalAddr] - cacheSuperblocks []*diskio.Ref[btrfsvol.PhysicalAddr, Superblock] - cacheSuperblock *Superblock + cacheSuperblocks []*diskio.Ref[btrfsvol.PhysicalAddr, btrfstree.Superblock] + cacheSuperblock *btrfstree.Superblock } var _ diskio.File[btrfsvol.PhysicalAddr] = (*Device)(nil) @@ -27,18 +28,18 @@ var SuperblockAddrs = []btrfsvol.PhysicalAddr{ 0x40_0000_0000, // 256GiB } -func (dev *Device) Superblocks() ([]*diskio.Ref[btrfsvol.PhysicalAddr, Superblock], error) { +func (dev *Device) Superblocks() ([]*diskio.Ref[btrfsvol.PhysicalAddr, btrfstree.Superblock], error) { if dev.cacheSuperblocks != nil { return dev.cacheSuperblocks, nil } - superblockSize := btrfsvol.PhysicalAddr(binstruct.StaticSize(Superblock{})) + superblockSize := btrfsvol.PhysicalAddr(binstruct.StaticSize(btrfstree.Superblock{})) sz := dev.Size() - var ret []*diskio.Ref[btrfsvol.PhysicalAddr, Superblock] + var ret []*diskio.Ref[btrfsvol.PhysicalAddr, btrfstree.Superblock] for i, addr := range SuperblockAddrs { if addr+superblockSize <= sz { - superblock := &diskio.Ref[btrfsvol.PhysicalAddr, Superblock]{ + superblock := &diskio.Ref[btrfsvol.PhysicalAddr, btrfstree.Superblock]{ File: dev, Addr: addr, } @@ -55,7 +56,7 @@ func (dev *Device) Superblocks() ([]*diskio.Ref[btrfsvol.PhysicalAddr, Superbloc return ret, nil } -func (dev *Device) Superblock() (*Superblock, error) { +func (dev *Device) Superblock() (*btrfstree.Superblock, error) { if dev.cacheSuperblock != nil { return dev.cacheSuperblock, nil } |