mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-24 12:34:31 +00:00
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 <nkgold@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
parent
0ec62b285e
commit
7e41126c86
3 changed files with 4 additions and 4 deletions
|
@ -32,7 +32,7 @@ pub enum IoSource<F: base::AsRawDescriptor> {
|
|||
|
||||
pub enum AllocateMode {
|
||||
#[cfg(unix)]
|
||||
Default,
|
||||
Allocate,
|
||||
PunchHole,
|
||||
ZeroRange,
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ pub enum AllocateMode {
|
|||
impl From<AllocateMode> 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
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue