From 8d67790d2e253ad5df8bc9134068fcdd001b7cc2 Mon Sep 17 00:00:00 2001 From: MattJackson <1085847+MattJackson@users.noreply.github.com> Date: Sat, 9 May 2026 09:17:39 -0700 Subject: [PATCH] 0.18: thread WritebackFile rename through FileSectorSink The SectorSource/Sink agent and the WritebackFile-rename agent both branched from main concurrently; the sector branch wrote against the 0.17 Writer name and only the rename branch knew about WritebackFile. This integration commit reconciles the two: FileSectorSink::create / ::open / the inner-field type all use WritebackFile directly, and the module-level + struct-level docs are corrected. --- src/sector/file.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/sector/file.rs b/src/sector/file.rs index 9e95c51..23c7c13 100644 --- a/src/sector/file.rs +++ b/src/sector/file.rs @@ -3,12 +3,9 @@ //! //! [`FileSectorSource`] is the read side (open-only). [`FileSectorSink`] //! is the write side (create or open-rw); writes go through -//! [`crate::io::Writer`] so big sequential ISO writes share the -//! same bounded-cache writeback pipeline used by sweep / patch / -//! mux. `Writer` is the 0.17 name; the 0.18 redesign renames it -//! to `WritebackFile` in a separate slice — this file deliberately -//! imports through the `crate::io::Writer` path so the rename can -//! be applied independently. +//! [`crate::io::WritebackFile`] so big sequential ISO writes share +//! the same bounded-cache writeback pipeline used by sweep / patch / +//! mux. use std::fs::{File, OpenOptions}; use std::io::{BufReader, Read, Seek, SeekFrom, Write}; @@ -83,14 +80,14 @@ impl SectorReader for FileSectorSource { /// SectorSink backed by a file (ISO image). /// -/// Writes go through [`crate::io::Writer`], which on Linux drives +/// Writes go through [`crate::io::WritebackFile`], which on Linux drives /// continuous `sync_file_range` + `posix_fadvise(DONTNEED)` to keep /// the kernel dirty page cache bounded during multi-GB sequential /// writes. macOS / Windows fall through to a no-op pipeline. /// /// `finish` runs `sync_all` before dropping the underlying file. pub struct FileSectorSink { - inner: crate::io::Writer, + inner: crate::io::WritebackFile, } impl FileSectorSink { @@ -106,7 +103,7 @@ impl FileSectorSink { .truncate(true) .open(path)?; Ok(Self { - inner: crate::io::Writer::new(file)?, + inner: crate::io::WritebackFile::new(file)?, }) } @@ -116,7 +113,7 @@ impl FileSectorSink { pub fn open(path: &Path) -> std::io::Result { let file = OpenOptions::new().read(true).write(true).open(path)?; Ok(Self { - inner: crate::io::Writer::new(file)?, + inner: crate::io::WritebackFile::new(file)?, }) } }