package mgit
Module Mgit_blk.MakeSource
Parameters
Signature
bounds t which is the absolute offset and the length (in bytes) of the requested zone on the block-device.
cachet t which ~base ~len is a Cachet.t whose logical address 0 is the byte base of the zone which and which never reads further than base + len. Out of bounds reads return an empty bigstring, as Cachet.map requires.
seq t which ~off ~len () streams len bytes of the zone which, starting at the byte off of that zone.
sync t upgrades the current active zone and atomically save it into the block device.
commit t sets the current active zone (the inactive zone becomes active and vice-versa) and atomically save it into the block device.
expand ~used ~length t grows the layout of t to length bytes (the length of the block-device by default) by keeping the ratio between the temporary zone and the zones A and B. used is the number of bytes of the active zone which must be kept (the whole zone by default). If the current layout already covers length bytes, t is returned unchanged.
The active zone is copied into a zone of the new layout which does not overlap it, then the superblock is updated: a failure in the middle of expand keeps the old layout valid.