let fs_dev = new blocksize_overlay block_size dev in
{
- fs_cb = callbacks;
+ fs_cb = callbacks ();
fs_dev = fs_dev;
fs_blocksize = block_size;
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;
-}
+and callbacks =
+ let i = ref 0 in
+ fun () -> {
+ fs_cb_uq = (incr i; !i);
+ 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
let fs_dev = new blocksize_overlay blocksize dev in
{
- fs_cb = callbacks;
+ fs_cb = callbacks ();
fs_dev = fs_dev;
fs_blocksize = blocksize;
*)
and offset_is_free _ offset = offset >= blocksize
-and callbacks = {
- fs_cb_name = id;
- fs_cb_printable_name = "Linux swap";
- fs_cb_offset_is_free = offset_is_free;
-}
+and callbacks =
+ let i = ref 0 in
+ fun () -> {
+ fs_cb_uq = (incr i; !i);
+ fs_cb_name = id;
+ fs_cb_printable_name = "Linux swap";
+ fs_cb_offset_is_free = offset_is_free;
+ }
(* Register the plugin. *)
let () = register_plugin ~filesystem:probe id
let fs_dev = new blocksize_overlay blocksize dev in
{
- fs_cb = callbacks;
+ fs_cb = callbacks ();
fs_dev = fs_dev;
fs_blocksize = blocksize;
*)
and offset_is_free _ _ = false
-and callbacks = {
- fs_cb_name = id;
- fs_cb_printable_name = "Linux s/w suspend";
- fs_cb_offset_is_free = offset_is_free;
-}
+and callbacks =
+ let i = ref 0 in
+ fun () -> {
+ fs_cb_uq = (incr i; !i);
+ fs_cb_name = id;
+ fs_cb_printable_name = "Linux s/w suspend";
+ fs_cb_offset_is_free = offset_is_free;
+ }
(* Register the plugin. *)
let () = register_plugin ~filesystem:probe id
let uuid, _ = read_pv_label dev in
if !debug then
eprintf "LVM2 detected PV UUID %s\n%!" uuid;
- { pv_cb = callbacks; pv_uuid = uuid; pv_dev = dev }
+ { pv_cb = callbacks (); pv_uuid = uuid; pv_dev = dev }
with exn ->
if !debug then prerr_endline (Printexc.to_string exn);
raise Not_found
(* Finally we can set up devices for the LVs. *)
let lvs =
List.map (
- fun (vgname, (pvuuid, vgmeta, pvdevs, extent_size, lvs)) ->
+ fun (vgname, (pvuuids, vgmeta, pvdevs, extent_size, lvs)) ->
try
List.map (
fun (lvname, segments) ->
*)
and offset_is_free _ _ = false
-and callbacks = {
- lvm_cb_name = id;
- lvm_cb_list_lvs = list_lvs;
- lvm_cb_offset_is_free = offset_is_free;
-}
+and callbacks =
+ let i = ref 0 in
+ fun () -> {
+ lvm_cb_uq = (incr i; !i);
+ lvm_cb_name = id;
+ lvm_cb_list_lvs = list_lvs;
+ lvm_cb_offset_is_free = offset_is_free;
+ }
(* Register the plugin. *)
let () = register_plugin ~lvm:probe id