mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: Execute synchronous block requests positionally
Request::execute seeked the disk to the request sector and then read or wrote sequentially through the cursor. Walk a running offset with read_exact_at and write_all_at instead, and flush with fsync, so the bound becomes FileExt and FileSync rather than Seek, Read, and Write. The seek step is gone, so drop the now unused ExecuteError::Seek. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
06cad2cdcd
commit
15b59fdd9f
@@ -125,8 +125,6 @@ pub enum ExecuteError {
|
||||
ReadExact(#[source] io::Error),
|
||||
#[error("Can't execute an operation other than `read` or `get_id` on a read-only device")]
|
||||
ReadOnly,
|
||||
#[error("Failed to seek")]
|
||||
Seek(#[source] io::Error),
|
||||
#[error("Failed to write")]
|
||||
Write(#[source] GuestMemoryError),
|
||||
#[error("Failed to write_all")]
|
||||
@@ -161,7 +159,6 @@ impl ExecuteError {
|
||||
ExecuteError::Read(_) => VIRTIO_BLK_S_IOERR,
|
||||
ExecuteError::ReadExact(_) => VIRTIO_BLK_S_IOERR,
|
||||
ExecuteError::ReadOnly => VIRTIO_BLK_S_IOERR,
|
||||
ExecuteError::Seek(_) => VIRTIO_BLK_S_IOERR,
|
||||
ExecuteError::Write(_) => VIRTIO_BLK_S_IOERR,
|
||||
ExecuteError::WriteAll(_) => VIRTIO_BLK_S_IOERR,
|
||||
ExecuteError::Unsupported(_) => VIRTIO_BLK_S_UNSUPP,
|
||||
|
||||
Reference in New Issue
Block a user