+
+(* Linux swap space is always 'free', apart from the superblock.
+ * Compare diskimage_linux_swsuspend.ml
+ *)
+and offset_is_free _ offset = offset >= blocksize
+
+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