summaryrefslogtreecommitdiff
path: root/lib/btrfs/btrfsvol
diff options
context:
space:
mode:
Diffstat (limited to 'lib/btrfs/btrfsvol')
-rw-r--r--lib/btrfs/btrfsvol/chunk.go9
-rw-r--r--lib/btrfs/btrfsvol/devext.go6
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/btrfs/btrfsvol/chunk.go b/lib/btrfs/btrfsvol/chunk.go
index 2d26964..9c77a49 100644
--- a/lib/btrfs/btrfsvol/chunk.go
+++ b/lib/btrfs/btrfsvol/chunk.go
@@ -8,7 +8,8 @@ import (
"fmt"
"sort"
- "git.lukeshu.com/btrfs-progs-ng/lib/util"
+ "git.lukeshu.com/btrfs-progs-ng/lib/maps"
+ "git.lukeshu.com/btrfs-progs-ng/lib/slices"
)
// logical => []physical
@@ -51,8 +52,8 @@ func (a chunkMapping) union(rest ...chunkMapping) (chunkMapping, error) {
beg := chunks[0].LAddr
end := chunks[0].LAddr.Add(chunks[0].Size)
for _, chunk := range chunks {
- beg = util.Min(beg, chunk.LAddr)
- end = util.Max(end, chunk.LAddr.Add(chunk.Size))
+ beg = slices.Min(beg, chunk.LAddr)
+ end = slices.Max(end, chunk.LAddr.Add(chunk.Size))
}
ret := chunkMapping{
LAddr: beg,
@@ -78,7 +79,7 @@ func (a chunkMapping) union(rest ...chunkMapping) (chunkMapping, error) {
}] = struct{}{}
}
}
- ret.PAddrs = util.MapKeys(paddrs)
+ ret.PAddrs = maps.Keys(paddrs)
sort.Slice(ret.PAddrs, func(i, j int) bool {
return ret.PAddrs[i].Cmp(ret.PAddrs[j]) < 0
})
diff --git a/lib/btrfs/btrfsvol/devext.go b/lib/btrfs/btrfsvol/devext.go
index 1f6cabe..83ece99 100644
--- a/lib/btrfs/btrfsvol/devext.go
+++ b/lib/btrfs/btrfsvol/devext.go
@@ -7,7 +7,7 @@ package btrfsvol
import (
"fmt"
- "git.lukeshu.com/btrfs-progs-ng/lib/util"
+ "git.lukeshu.com/btrfs-progs-ng/lib/slices"
)
// physical => logical
@@ -48,8 +48,8 @@ func (a devextMapping) union(rest ...devextMapping) (devextMapping, error) {
beg := exts[0].PAddr
end := beg.Add(exts[0].Size)
for _, ext := range exts {
- beg = util.Min(beg, ext.PAddr)
- end = util.Max(end, ext.PAddr.Add(ext.Size))
+ beg = slices.Min(beg, ext.PAddr)
+ end = slices.Max(end, ext.PAddr.Add(ext.Size))
}
ret := devextMapping{
PAddr: beg,