block: qcow: Port RawFile to AlignedFile

Reuse the functionality in the AlignedFile wrapper for the QCOW RawFile
wrapper. This makes alignment handling more transparent.

Assisted-by: Claude:Opus-4.8
Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
Rob Bradford
2026-06-12 10:03:59 +01:00
parent 3fe5225a44
commit 80a0393edd
3 changed files with 54 additions and 122 deletions

View File

@@ -31,7 +31,6 @@ pub(crate) struct AlignedFile {
alignment: usize,
}
#[cfg_attr(not(test), expect(dead_code))]
impl AlignedFile {
/// Wrap `file`, probing the O_DIRECT block alignment when `direct_io`.
pub fn new(file: File, direct_io: bool) -> Self {