summaryrefslogtreecommitdiff
path: root/lib/btrfs/btrfsvol/chunk.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-02-05 00:31:29 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-02-12 02:43:16 -0700
commit696a7d192e5eefa53230168a4b200ec0560c8a10 (patch)
tree039c3c549414c21b15d58c3d695ee87c3feb1402 /lib/btrfs/btrfsvol/chunk.go
parentb608e4cf9c9e6e5bf5a333e8d78b2800ffcb0c91 (diff)
containers: Rethink the RBTree interface to be simpler
Diffstat (limited to 'lib/btrfs/btrfsvol/chunk.go')
-rw-r--r--lib/btrfs/btrfsvol/chunk.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/btrfs/btrfsvol/chunk.go b/lib/btrfs/btrfsvol/chunk.go
index 08a0b2b..a112fd3 100644
--- a/lib/btrfs/btrfsvol/chunk.go
+++ b/lib/btrfs/btrfsvol/chunk.go
@@ -22,7 +22,10 @@ type chunkMapping struct {
Flags containers.Optional[BlockGroupFlags]
}
-type ChunkMapping = chunkMapping
+// Compare implements containers.Ordered.
+func (a chunkMapping) Compare(b chunkMapping) int {
+ return containers.NativeCompare(a.LAddr, b.LAddr)
+}
// return -1 if 'a' is wholly to the left of 'b'
// return 0 if there is some overlap between 'a' and 'b'