pub enum WritePlan {
Plain(Vec<StripePlacement>),
Parity(ParityPlan),
}Expand description
Result of ChunkTreeCache::plan_write.
Non-parity profiles (SINGLE / DUP / RAID1* / RAID0 / RAID10) produce a
Plain plan: a flat list of placements, each a slice of the caller’s
buffer to a (devid, physical) location. RAID5 and RAID6 produce a
Parity plan: per-row descriptors that the executor must read into
scratch buffers, mix with the caller’s bytes, compute parity over,
then write data + parity slices to the device columns.
Variants§
Plain(Vec<StripePlacement>)
SINGLE / DUP / RAID1* / RAID0 / RAID10 placements. The caller just iterates the vec and writes slices of its buffer.
Parity(ParityPlan)
RAID5 / RAID6 placements. The caller must run the parity executor: preread every data column slot of every touched row, overlay caller bytes, compute P (and Q for RAID6), then write the overlaid byte ranges and the parity slots.