mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: Remove legacy async I/O API
Drop the borrowed iovec AsyncIo entry points now that all callers use owned operations. Rename the transitional owned batch and completion methods to the final trait names and remove the borrowed submission helpers from the queue wrappers. This removes a bunch of known safety foot-guns so future-us don't accidentally use them. Assisted-by: Codex:GPT-5.5 Signed-off-by: Dylan Reid <dgreid@fb.com>
This commit is contained in:
@@ -22,7 +22,7 @@ use crate::util::{
|
||||
};
|
||||
|
||||
/// Submit num_ops AIO writes, wait for them all to land, then time
|
||||
/// how long it takes to drain every completion via next_completion().
|
||||
/// how long it takes to drain every completion via next_completed_request().
|
||||
///
|
||||
/// Returns the drain wall clock time in seconds.
|
||||
pub fn micro_bench_aio_drain(control: &PerformanceTestControl) -> f64 {
|
||||
@@ -50,7 +50,7 @@ pub fn micro_bench_aio_drain(control: &PerformanceTestControl) -> f64 {
|
||||
let start = Instant::now();
|
||||
let mut drained = 0usize;
|
||||
while drained < num_ops {
|
||||
if aio.next_completion().is_some() {
|
||||
if aio.next_completed_request().is_some() {
|
||||
drained += 1;
|
||||
}
|
||||
}
|
||||
@@ -421,7 +421,7 @@ pub fn micro_bench_qcow_batch_read(control: &PerformanceTestControl) -> f64 {
|
||||
|
||||
let start = Instant::now();
|
||||
async_io
|
||||
.submit_batch_operations(batch)
|
||||
.submit_batch_requests(batch)
|
||||
.expect("submit_batch_requests failed");
|
||||
|
||||
// Drain all io_uring completions before stopping the clock.
|
||||
@@ -631,7 +631,7 @@ pub fn micro_bench_qcow_batch_write(control: &PerformanceTestControl) -> f64 {
|
||||
|
||||
let start = Instant::now();
|
||||
async_io
|
||||
.submit_batch_operations(batch)
|
||||
.submit_batch_requests(batch)
|
||||
.expect("submit_batch_requests failed");
|
||||
|
||||
drain_async_completions(async_io.as_mut(), num_ops);
|
||||
|
||||
@@ -81,7 +81,7 @@ pub fn qcow_async_tempfile(num_clusters: usize) -> (TempFile, QcowDisk) {
|
||||
/// Drain `count` completions from a synchronous async_io backend.
|
||||
pub fn drain_completions(async_io: &mut dyn AsyncIo, count: usize) {
|
||||
for _ in 0..count {
|
||||
async_io.next_completion();
|
||||
async_io.next_completed_request();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ pub fn drain_async_completions(async_io: &mut dyn AsyncIo, count: usize) {
|
||||
let mut drained = 0usize;
|
||||
while drained < count {
|
||||
wait_for_eventfd(async_io.notifier());
|
||||
while async_io.next_completion().is_some() {
|
||||
while async_io.next_completed_request().is_some() {
|
||||
drained += 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user