summaryrefslogtreecommitdiff
path: root/lib/btrfs
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2022-07-16 16:12:08 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2022-07-16 20:10:43 -0600
commit8edb8ab9ac42e9bfb851b3bc41509e782555f053 (patch)
tree006b961b6f7a67184f28c86f185419a330d8fb88 /lib/btrfs
parent5889f1fa2818f34025ca6e2feecb26928c6e6341 (diff)
rethink the SumRun interface to fit diskio.Sequence
Diffstat (limited to 'lib/btrfs')
-rw-r--r--lib/btrfs/btrfsvol/addr.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/btrfs/btrfsvol/addr.go b/lib/btrfs/btrfsvol/addr.go
index 76b531d..94320ef 100644
--- a/lib/btrfs/btrfsvol/addr.go
+++ b/lib/btrfs/btrfsvol/addr.go
@@ -56,3 +56,13 @@ func (a QualifiedPhysicalAddr) Cmp(b QualifiedPhysicalAddr) int {
}
return int(a.Addr - b.Addr)
}
+
+type _IntAddr[T any] interface {
+ ~int64
+ Sub(T) AddrDelta
+ Add(AddrDelta) T
+}
+
+// IntAddr is a type constraint that you can use to accept LogicalAddr
+// or PhysicalAddr.
+type IntAddr[T _IntAddr[T]] _IntAddr[T]