+
+(* Find out if a disk offset is free.
+ * Current algorithm just checks that at least one owner says
+ * it is free. We could be smarter about this.
+ *)
+let offset_is_free owners =
+ List.exists (
+ function
+ | `Filesystem fs, offset -> fs_offset_is_free fs offset
+ | `Partitions parts, offset -> parts_offset_is_free parts offset
+ | `PhysicalVolume pv, offset -> lvm_offset_is_free pv offset
+ ) owners