block: qcow: Expose RawFile alignment as a public accessor

Add pub fn alignment() to RawFile so that callers can
query the O_DIRECT buffer alignment requirement probed
at file open time.

Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
Anatol Belski
2026-04-13 19:50:15 +02:00
committed by Rob Bradford
parent c35749fb39
commit 6c1da4f5c1

View File

@@ -125,6 +125,10 @@ impl RawFile {
self.direct_io
}
pub fn alignment(&self) -> usize {
self.alignment
}
/// Returns true if the file was opened with write access.
pub fn is_writable(&self) -> bool {
// SAFETY: fcntl with F_GETFL is safe and doesn't modify the file descriptor