From 556cb6be46bb4b65a53aa64db2173e9b0a7b5502 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 23 Apr 2026 15:50:53 +0200 Subject: [PATCH] performance-metrics: Use RawDisk for AIO micro benchmark Replace direct RawFileAsyncAio construction with RawDisk and create_async_io, consistent with the unified API. Assisted-by: Claude:Opus-4.6 Signed-off-by: Anatol Belski --- performance-metrics/src/micro_bench_block.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/performance-metrics/src/micro_bench_block.rs b/performance-metrics/src/micro_bench_block.rs index 4e7cb52a3..6dbdee92f 100644 --- a/performance-metrics/src/micro_bench_block.rs +++ b/performance-metrics/src/micro_bench_block.rs @@ -7,12 +7,10 @@ //! These run without booting a VM and measure hot path operations //! (e.g. AIO completion draining) at the syscall level. -use std::os::unix::io::AsRawFd; use std::time::Instant; -use block::async_io::AsyncIo; use block::disk_file::AsyncDiskFile; -use block::raw_async_aio::RawFileAsyncAio; +use block::raw_disk::{RawBackend, RawDisk}; use block::{BatchRequest, RequestType}; use crate::PerformanceTestControl; @@ -29,8 +27,10 @@ use crate::util::{ pub fn micro_bench_aio_drain(control: &PerformanceTestControl) -> f64 { let num_ops = control.num_ops.expect("num_ops required") as usize; let tmp = util::sized_tempfile(num_ops); - let fd = tmp.as_file().as_raw_fd(); - let mut aio = RawFileAsyncAio::new(fd, num_ops as u32).expect("failed to create AIO context"); + let disk = RawDisk::new(tmp.as_file().try_clone().unwrap(), RawBackend::Aio); + let mut aio = disk + .create_async_io(num_ops as u32) + .expect("failed to create AIO context"); let buf = vec![0xA5u8; BLOCK_SIZE as usize];