+ (* Map block (extent) i to the underlying device. *)
+ method map_block i =
+ match self#map i with
+ | Some (_, _, dev, dev_offset, _) -> [dev, dev_offset]
+ | None -> []
+
+ (* Continguous span. *)
+ method contiguous offset =
+ let offset_in_extents = offset /^ extent_size in
+
+ (* Get the segment that this offset lies in. *)
+ match self#map offset_in_extents with
+ | Some (_, end_extent, dev, dev_offset, _) ->
+ (* Contiguous bytes up to the end of this extent. *)
+ end_extent *^ extent_size -^ offset
+ | None -> ~^0
+