pub(super) struct RefTable {
cluster: Option<HostCluster>,
data: Box<[RefTableEntry]>,
cluster_bits: u32,
modified: AtomicBool,
}Expand description
Refcount table.
Fields§
§cluster: Option<HostCluster>First cluster in the image file.
data: Box<[RefTableEntry]>Table data.
cluster_bits: u32log2 of the cluster size.
modified: AtomicBoolWhether this table has been modified since it was last written.
Implementations§
Source§impl RefTable
impl RefTable
Sourcepub fn clone_and_grow(
&self,
header: &Header,
at_least_index: usize,
) -> Result<Self>
pub fn clone_and_grow( &self, header: &Header, at_least_index: usize, ) -> Result<Self>
Create a clone that covers at least at_least_index.
Also ensure that beyond at_least_index, there are enough entries to self-describe the new
refcount table (so that it can actually be allocated).
Sourcepub fn enter_refblock(
&mut self,
index: usize,
rb: &RefBlock,
new_allocation: Option<PendingClusters>,
) -> Result<()>
pub fn enter_refblock( &mut self, index: usize, rb: &RefBlock, new_allocation: Option<PendingClusters>, ) -> Result<()>
Enter the given refcount block into this refcount table.
If the refblock’s cluster has been newly allocated, new_allocation must be its pending
clusters guard, which is disarmed once the refblock is entered.
Trait Implementations§
Source§impl Table for RefTable
impl Table for RefTable
Source§const MAX_ENTRIES: usize = <L1Table as Table>::MAX_ENTRIES
const MAX_ENTRIES: usize = <L1Table as Table>::MAX_ENTRIES
Maximum number of refcount table entries.
Not in QEMU, but makes sense to limit to the same as the L1 table. Note that refcount blocks usually cover more clusters than an L2 table, so this generally allows larger image files than would be necessary for the maximum guest disk size determined by the maximum number of L1 entries.