Maps a guest write address to a write mapping. Always takes a write lock since writes may need to allocate clusters, update L2 entries and update refcounts. The backing_data parameter is the COW source. If the cluster is unallocated and a backing file exists, the caller should have already read the backing cluster data and pass it here. If None, the new cluster is zeroed.
(
&self,
address: u64,
backing_data: Option<Vec<u8>>,
)
| 228 | /// read the backing cluster data and pass it here. If None, the new |
| 229 | /// cluster is zeroed. |
| 230 | pub fn map_cluster_for_write( |
| 231 | &self, |
| 232 | address: u64, |
| 233 | backing_data: Option<Vec<u8>>, |
| 234 | ) -> io::Result<ClusterWriteMapping> { |
| 235 | let mut inner = self.inner.write().unwrap(); |
| 236 | inner.map_write(address, backing_data) |
| 237 | } |
| 238 | |
| 239 | pub fn flush(&self) -> io::Result<()> { |
| 240 | let mut inner = self.inner.write().unwrap(); |
no test coverage detected