method mapblock i = [dev, i *^ Int64.of_int blocksize +^ start]
end
+(* A device with just a modified block size. *)
+class blocksize_overlay new_blocksize (dev : device) =
+object
+ inherit device
+ method name = dev#name
+ method size = dev#size
+ method read offset len = dev#read offset len
+ method blocksize = new_blocksize
+ method mapblock new_blk =
+ let orig_blk =
+ new_blk *^ Int64.of_int new_blocksize /^ Int64.of_int dev#blocksize in
+ dev#mapblock orig_blk
+end
+
(* The null device. Any attempt to read generates an error. *)
let null_device : device =
object
(* Filesystems (also swap devices). *)
and filesystem = {
+ fs_dev : device; (* Device containing the filesystem. *)
fs_plugin_id : fs_plugin_id; (* Filesystem. *)
fs_block_size : int64; (* Block size (bytes). *)
fs_blocks_total : int64; (* Total blocks. *)