-and read_metadata dev offset len =
- if !debug then
- eprintf "metadata: offset %s len %s bytes\n%!"
- (Int63.to_string offset) (Int63.to_string len);
-
- (* Check the offset and length are sensible. *)
- if offset <= ~^0x1200 || offset >= dev#size
- || len <= ~^0 || offset +^ len >= dev#size then
- invalid_arg "LVM2: read_metadata: bad metadata offset or length";
-
- (* If it is outside the disk boundaries, this will throw an exception,
- * otherwise it will read and return the metadata string.
- *)
- dev#read offset len
-