MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / limit_range_cluster

Method limit_range_cluster

block/src/qcow/mod.rs:1361–1365  ·  view source on GitHub ↗

Limits the range so that it doesn't overflow the end of a cluster.

(&self, address: u64, count: usize)

Source from the content-addressed store, hash-verified

1359
1360 // Limits the range so that it doesn't overflow the end of a cluster.
1361 fn limit_range_cluster(&self, address: u64, count: usize) -> usize {
1362 let offset: u64 = self.raw_file.cluster_offset(address);
1363 let limit = self.raw_file.cluster_size() - offset;
1364 min(count as u64, limit) as usize
1365 }
1366
1367 // Gets the maximum virtual size of this image.
1368 fn virtual_size(&self) -> u64 {

Callers 3

deallocate_bytesMethod · 0.80
readMethod · 0.80
writeMethod · 0.80

Calls 2

cluster_offsetMethod · 0.80
cluster_sizeMethod · 0.45

Tested by

no test coverage detected