mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
committed by
Rob Bradford
parent
c35749fb39
commit
6c1da4f5c1
@@ -125,6 +125,10 @@ impl RawFile {
|
|||||||
self.direct_io
|
self.direct_io
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn alignment(&self) -> usize {
|
||||||
|
self.alignment
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns true if the file was opened with write access.
|
/// Returns true if the file was opened with write access.
|
||||||
pub fn is_writable(&self) -> bool {
|
pub fn is_writable(&self) -> bool {
|
||||||
// SAFETY: fcntl with F_GETFL is safe and doesn't modify the file descriptor
|
// SAFETY: fcntl with F_GETFL is safe and doesn't modify the file descriptor
|
||||||
|
|||||||
Reference in New Issue
Block a user