block: Add AlignedFile

Provide a single home for O_DIRECT alignment and RMW behavior behind an
std::os::unix::fs::FileExt implementation built on AlignedBuffer.

Unaligned requests are bounced through an AlignedBuffer (applying RMW
for writes) and aligned requests pass straight through to the inner
File.

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:01:59 +01:00
parent 201ddaef55
commit 3fe5225a44
2 changed files with 191 additions and 0 deletions
+1
View File
@@ -15,6 +15,7 @@ pub mod factory;
mod io_impl;
pub use io_impl::{async_io, fcntl, request};
pub(crate) mod aligned_buffer;
pub(crate) mod aligned_file;
pub mod formats;
mod sparse;
use std::alloc::{Layout, alloc_zeroed};