From 7e41126c86df16d28c994e99e5cc6e950ca819cf Mon Sep 17 00:00:00 2001 From: Frederick Mayle Date: Mon, 3 Apr 2023 15:41:55 -0700 Subject: [PATCH] cros_async: rename AllocateMode's Default to Allocate Suggested in https://crrev.com/c/4312808 Change-Id: Ia3a31375bfa22b99b5c59279f1132ad3898f1df0 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4396702 Reviewed-by: Noah Gold Reviewed-by: Daniel Verkamp --- cros_async/src/io_source.rs | 4 ++-- cros_async/src/sys/unix/poll_source.rs | 2 +- cros_async/src/sys/unix/uring_source.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cros_async/src/io_source.rs b/cros_async/src/io_source.rs index 09f17f0f02..4606c4f343 100644 --- a/cros_async/src/io_source.rs +++ b/cros_async/src/io_source.rs @@ -32,7 +32,7 @@ pub enum IoSource { pub enum AllocateMode { #[cfg(unix)] - Default, + Allocate, PunchHole, ZeroRange, } @@ -42,7 +42,7 @@ pub enum AllocateMode { impl From for u32 { fn from(value: AllocateMode) -> Self { match value { - AllocateMode::Default => 0, + AllocateMode::Allocate => 0, AllocateMode::PunchHole => { (libc::FALLOC_FL_PUNCH_HOLE | libc::FALLOC_FL_KEEP_SIZE) as u32 } diff --git a/cros_async/src/sys/unix/poll_source.rs b/cros_async/src/sys/unix/poll_source.rs index f5ca162e95..6087d23cb9 100644 --- a/cros_async/src/sys/unix/poll_source.rs +++ b/cros_async/src/sys/unix/poll_source.rs @@ -412,7 +412,7 @@ mod tests { .unwrap(); let source = PollSource::new(f, ex).unwrap(); source - .fallocate(0, 4096, AllocateMode::Default) + .fallocate(0, 4096, AllocateMode::Allocate) .await .unwrap(); diff --git a/cros_async/src/sys/unix/uring_source.rs b/cros_async/src/sys/unix/uring_source.rs index 773fcb5379..6806250065 100644 --- a/cros_async/src/sys/unix/uring_source.rs +++ b/cros_async/src/sys/unix/uring_source.rs @@ -501,7 +501,7 @@ mod tests { .open(&file_path) .unwrap(); let source = UringSource::new(f, ex).unwrap(); - if let Err(e) = source.fallocate(0, 4096, AllocateMode::Default).await { + if let Err(e) = source.fallocate(0, 4096, AllocateMode::Allocate).await { match e { crate::io_ext::Error::Uring(super::super::uring_executor::Error::Io( io_err,