mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: Create io/ module for shared I/O infrastructure
Move async_io.rs, fcntl.rs, and request.rs into block/src/io/. These files are generic I/O infrastructure shared by all formats rather than format specific code. The io/ directory name clashes with std::io in lib.rs, so the module is declared as io_impl via #[path] and the submodules are re-exported at the crate root to keep existing import paths working. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
2689cf9bdb
commit
b68349f8b3
@@ -61,7 +61,7 @@ pub struct BorrowedDiskFd<'fd> {
|
||||
}
|
||||
|
||||
impl BorrowedDiskFd<'_> {
|
||||
pub(super) fn new(raw_fd: RawFd) -> Self {
|
||||
pub(crate) fn new(raw_fd: RawFd) -> Self {
|
||||
Self {
|
||||
raw_fd,
|
||||
_lifetime: PhantomData,
|
||||
12
block/src/io/mod.rs
Normal file
12
block/src/io/mod.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
// Copyright 2026 The Cloud Hypervisor Authors. All rights reserved.
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
//! Shared I/O infrastructure for all disk format backends.
|
||||
//!
|
||||
//! Contains the async I/O trait, request handling, and file locking
|
||||
//! helpers.
|
||||
|
||||
pub mod async_io;
|
||||
pub mod fcntl;
|
||||
pub mod request;
|
||||
@@ -8,11 +8,12 @@
|
||||
//
|
||||
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
|
||||
|
||||
pub mod async_io;
|
||||
pub mod disk_file;
|
||||
pub mod error;
|
||||
pub mod factory;
|
||||
pub mod fcntl;
|
||||
#[path = "io/mod.rs"]
|
||||
mod io_impl;
|
||||
pub use io_impl::{async_io, fcntl, request};
|
||||
pub mod fixed_vhd;
|
||||
#[cfg(feature = "io_uring")]
|
||||
/// Enabled with the `"io_uring"` feature
|
||||
@@ -32,7 +33,6 @@ pub(crate) mod raw_async_aio;
|
||||
mod raw_async_io_tests;
|
||||
pub mod raw_disk;
|
||||
pub(crate) mod raw_sync;
|
||||
mod request;
|
||||
mod sparse;
|
||||
pub use sparse::{BLKDISCARD, BLKZEROOUT};
|
||||
pub mod vhd;
|
||||
|
||||
Reference in New Issue
Block a user