Add a fs_dev field to filesystem
[virt-df.git] / lib / diskimage_ext2.ml
index 1b70977..f9913ca 100644 (file)
@@ -113,7 +113,14 @@ let probe dev =
    let overhead = Int64.of_int32 s_first_data_block in
    let overhead = (* XXX *) overhead in
 
+   (* The blocksize of the filesystem is likely to be quite different
+    * from that of the underlying device, so create an overlay device
+    * with the natural filesystem blocksize.
+    *)
+   let fs_dev = new blocksize_overlay (Int64.to_int block_size) dev in
+
    {
+     fs_dev = fs_dev;
      fs_plugin_id = plugin_id;
      fs_block_size = block_size;
      fs_blocks_total = Int64.of_int32 s_blocks_count -^ overhead;