diff options
-rw-r--r-- | pkg/btrfs/io1_device.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/pkg/btrfs/io1_device.go b/pkg/btrfs/io1_device.go index 32070cd..29af11c 100644 --- a/pkg/btrfs/io1_device.go +++ b/pkg/btrfs/io1_device.go @@ -15,6 +15,8 @@ type Device struct { cacheSuperblock *util.Ref[PhysicalAddr, Superblock] } +var _ util.File[PhysicalAddr] = (*Device)(nil) + func (dev Device) Size() (PhysicalAddr, error) { fi, err := dev.Stat() if err != nil { @@ -23,12 +25,6 @@ func (dev Device) Size() (PhysicalAddr, error) { return PhysicalAddr(fi.Size()), nil } -var SuperblockAddrs = []PhysicalAddr{ - 0x00_0001_0000, // 64KiB - 0x00_0400_0000, // 64MiB - 0x40_0000_0000, // 256GiB -} - func (dev *Device) ReadAt(dat []byte, paddr PhysicalAddr) (int, error) { return dev.File.ReadAt(dat, int64(paddr)) } @@ -37,6 +33,12 @@ func (dev *Device) WriteAt(dat []byte, paddr PhysicalAddr) (int, error) { return dev.File.WriteAt(dat, int64(paddr)) } +var SuperblockAddrs = []PhysicalAddr{ + 0x00_0001_0000, // 64KiB + 0x00_0400_0000, // 64MiB + 0x40_0000_0000, // 256GiB +} + func (dev *Device) Superblocks() ([]*util.Ref[PhysicalAddr, Superblock], error) { if dev.cacheSuperblocks != nil { return dev.cacheSuperblocks, nil |