package qcow

  1. Overview
  2. Docs
type t

A cluster map which describes cluster usage in the file. The cluster map tracks which clusters are free, and which are used, and where the references are.

type cluster = int64
type reference = cluster * int
module ClusterMap : Map.S with type key = cluster
val make : free:ClusterSet.t -> first_movable_cluster:cluster -> t

Given a set of free clusters, and the first cluster which can be moved (i.e. that isn't fixed header), construct an empty cluster map.

val total_used : t -> int64

Return the number of tracked used clusters

val total_free : t -> int64

Return the number of tracked free clusters

val add : t -> reference -> cluster -> t

add t ref cluster marks cluster as in-use and notes the reference from reference.

module Move : sig ... end
val compact_s : (Move.t -> t -> 'a -> [ `Ok of 'a | `Error of 'b ] Lwt.t) -> t -> 'a -> [ `Ok of 'a | `Error of 'b ] Lwt.t

compact_s f t acc accumulates the result of f move t' where move is the next cluster move needed to perform a compaction of t and t' is the state of t after the move has been completed.

val get_last_block : t -> int64

get_last_block t is the last allocated block in t. Note if there are no data blocks this will point to the last header block even though it is immovable.


Innovation. Community. Security.