summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/btrfsmisc/fsck.go4
-rw-r--r--pkg/util/ref.go5
2 files changed, 4 insertions, 5 deletions
diff --git a/pkg/btrfsmisc/fsck.go b/pkg/btrfsmisc/fsck.go
index 81317ce..28b93ba 100644
--- a/pkg/btrfsmisc/fsck.go
+++ b/pkg/btrfsmisc/fsck.go
@@ -82,5 +82,9 @@ func ScanForNodes(dev *btrfs.Device, sb btrfs.Superblock, fn func(*util.Ref[btrf
pos += btrfs.PhysicalAddr(sb.NodeSize) - btrfs.PhysicalAddr(sb.SectorSize)
}
+ if prog != nil {
+ prog(devSize)
+ }
+
return nil
}
diff --git a/pkg/util/ref.go b/pkg/util/ref.go
index 05ef08f..57f2eac 100644
--- a/pkg/util/ref.go
+++ b/pkg/util/ref.go
@@ -43,15 +43,10 @@ func (r *Ref[A, T]) Read() error {
}
func (r *Ref[A, T]) Write() error {
- size := binstruct.StaticSize(r.Data)
buf, err := binstruct.Marshal(r.Data)
if err != nil {
return err
}
- if len(buf) != size {
- return fmt.Errorf("util.Ref[%T].Write: expected to want to write %d bytes, but got %d bytes to write",
- r.Data, size, len(buf))
- }
if _, err = r.File.WriteAt(buf, r.Addr); err != nil {
return err
}