Fix dumb conflict errors

This commit is contained in:
Diego Reis
2025-04-07 23:05:01 -03:00
parent d9bf383507
commit 09d83aadf3
4 changed files with 21 additions and 29 deletions

View File

@@ -1,18 +1,16 @@
use super::MemoryIO;
use crate::{Clock, Completion, File, Instant, LimboError, OpenFlags, Result, IO};
use std::cell::RefCell;
use std::io::{Read, Seek, Write};
use std::sync::Arc;
use tracing::{debug, trace};
use super::MemoryIO;
pub struct GenericIO {
}
pub struct GenericIO {}
impl GenericIO {
pub fn new() -> Result<Self> {
debug!("Using IO backend 'generic'");
Ok(Self {
})
Ok(Self {})
}
}
@@ -42,6 +40,10 @@ impl IO for GenericIO {
getrandom::getrandom(&mut buf).unwrap();
i64::from_ne_bytes(buf)
}
fn get_memory_io(&self) -> Arc<MemoryIO> {
Arc::new(MemoryIO::new())
}
}
impl Clock for GenericIO {
@@ -52,10 +54,6 @@ impl Clock for GenericIO {
micros: now.timestamp_subsec_micros(),
}
}
fn get_memory_io(&self) -> Arc<MemoryIO> {
Arc::new(MemoryIO::new())
}
}
pub struct GenericFile {

View File

@@ -1,4 +1,5 @@
use super::{common, Completion, File, OpenFlags, WriteCompletion, IO};
use crate::io::clock::{Clock, Instant};
use crate::{LimboError, MemoryIO, Result};
use rustix::fs::{self, FlockOperation, OFlags};
use rustix::io_uring::iovec;
@@ -11,7 +12,6 @@ use std::rc::Rc;
use std::sync::Arc;
use thiserror::Error;
use tracing::{debug, trace};
use crate::io::clock::{Clock, Instant};
const MAX_IOVECS: u32 = 128;
const SQPOLL_IDLE: u32 = 1000;
@@ -197,6 +197,10 @@ impl IO for UringIO {
getrandom::getrandom(&mut buf).unwrap();
i64::from_ne_bytes(buf)
}
fn get_memory_io(&self) -> Arc<MemoryIO> {
Arc::new(MemoryIO::new())
}
}
impl Clock for UringIO {
@@ -207,10 +211,6 @@ impl Clock for UringIO {
micros: now.timestamp_subsec_micros(),
}
}
fn get_memory_io(&self) -> Arc<MemoryIO> {
Arc::new(MemoryIO::new())
}
}
pub struct UringFile {

View File

@@ -51,8 +51,8 @@ impl IO for VfsMod {
unsafe { (vfs.gen_random_number)() }
}
fn get_memory_io(&self) -> Option<Arc<MemoryIO>> {
Some(Arc::new(MemoryIO::new()))
fn get_memory_io(&self) -> Arc<MemoryIO> {
Arc::new(MemoryIO::new())
}
}
@@ -69,10 +69,6 @@ impl VfsMod {
cstr.to_string_lossy().into_owned()
}
}
fn get_memory_io(&self) -> Arc<MemoryIO> {
Arc::new(MemoryIO::new())
}
}
impl File for VfsFileImpl {

View File

@@ -1,17 +1,15 @@
use super::MemoryIO;
use crate::{Clock, Completion, File, Instant, LimboError, OpenFlags, Result, IO};
use std::cell::RefCell;
use std::io::{Read, Seek, Write};
use std::sync::Arc;
use tracing::{debug, trace};
use super::MemoryIO;
pub struct WindowsIO {
}
pub struct WindowsIO {}
impl WindowsIO {
pub fn new() -> Result<Self> {
debug!("Using IO backend 'syscall'");
Ok(Self {
})
Ok(Self {})
}
}
@@ -40,6 +38,10 @@ impl IO for WindowsIO {
getrandom::getrandom(&mut buf).unwrap();
i64::from_ne_bytes(buf)
}
fn get_memory_io(&self) -> Arc<MemoryIO> {
Arc::new(MemoryIO::new())
}
}
impl Clock for WindowsIO {
@@ -50,10 +52,6 @@ impl Clock for WindowsIO {
micros: now.timestamp_subsec_micros(),
}
}
fn get_memory_io(&self) -> Arc<MemoryIO> {
Arc::new(MemoryIO::new())
}
}
pub struct WindowsFile {