X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=lib%2Fdiskimage_ext2.ml;h=ade794023c9cd427fc7f85e8d100b3cf05004df8;hb=7a5fc851494dacaae801ef578c2b68d6184543f4;hp=3f72ca4e99df2704e5be0fbe6a26ca5c01475f38;hpb=063c6a300ed7ed6a9ec99d22159b3e246d08a70a;p=virt-df.git diff --git a/lib/diskimage_ext2.ml b/lib/diskimage_ext2.ml index 3f72ca4..ade7940 100644 --- a/lib/diskimage_ext2.ml +++ b/lib/diskimage_ext2.ml @@ -22,7 +22,7 @@ open Unix open Printf -open Diskimage_utils +open Diskimage_impl open Int63.Operators @@ -31,11 +31,11 @@ let ( -* ) = Int32.sub let ( ** ) = Int32.mul let ( /* ) = Int32.div -let plugin_id = "ext2" +let id = "ext2" let superblock_offset = ~^1024 let superblock_len = ~^1024 -let probe dev = +let rec probe dev = (* Load the superblock. *) let bits = dev#read_bitstring superblock_offset superblock_len in @@ -127,7 +127,7 @@ let probe dev = let fs_dev = new blocksize_overlay block_size dev in { - fs_plugin_id = plugin_id; + fs_cb = callbacks; fs_dev = fs_dev; fs_blocksize = block_size; @@ -150,3 +150,14 @@ let probe dev = | { _ } -> raise Not_found (* Not an EXT2/3 superblock. *) + +and offset_is_free _ _ = false + +and callbacks = { + fs_cb_name = id; + fs_cb_printable_name = "Linux ext2/3"; + fs_cb_offset_is_free = offset_is_free; +} + +(* Register the plugin. *) +let () = register_plugin ~filesystem:probe id