Module Qcow_recycler.Make
Parameters
B : Qcow_s.RESIZABLE_BLOCK
Time : Mirage_time.S
Signature
val create : base:B.t -> sector_size:int -> cluster_bits:int -> cache:Qcow_cache.t -> locks:Qcow_locks.t -> metadata:Qcow_metadata.t -> runtime_asserts:bool -> t
Initialise a cluster recycler over the given block device
val set_cluster_map : t -> Qcow_cluster_map.t -> unit
Set the associated cluster map (which will be updated on every cluster write)
val start_background_thread : t -> keep_erased:int64 -> ?compact_after_unmaps:int64 -> unit -> unit
Start a background thread which will perform block recycling
val allocate : t -> Qcow_types.Cluster.t -> Qcow_types.Cluster.IntervalSet.t option
allocate t n
returnsn
clusters which are ready for re-use. If there are not enough clusters free then this returns None.
val erase : t -> Qcow_types.Cluster.IntervalSet.t -> (unit, B.write_error) Stdlib.result Lwt.t
Write zeroes over the specified set of clusters
val copy : t -> Qcow_types.Cluster.t -> Qcow_types.Cluster.t -> (unit, B.write_error) Stdlib.result Lwt.t
copy src dst
copies the clustersrc
todst
val move_all : ?progress_cb:(percent:int -> unit) -> t -> Qcow_cluster_map.Move.t list -> (unit, Qcow_metadata.write_error) Stdlib.result Lwt.t
move_all t mv
perform the initial data copy of the move operationsmv
val update_references : t -> (int64, Qcow_metadata.write_error) Stdlib.result Lwt.t
update_references t
rewrites references to any recently copied and flushed block, returning the number of writes completed.