This commit is contained in:
pedrocarlo
2025-08-13 16:37:42 -03:00
parent 2d6fad5ea3
commit 71ca221390
3 changed files with 8 additions and 13 deletions

View File

@@ -535,13 +535,9 @@ impl IO for UringIO {
"fixed buffer length must be logical block aligned"
);
let mut inner = self.inner.borrow_mut();
let slot = inner
.free_arenas
.iter()
.position(|e| e.is_none())
.ok_or_else(|| {
crate::error::CompletionError::UringIOError("no free fixed buffer slots")
})?;
let slot = inner.free_arenas.iter().position(|e| e.is_none()).ok_or(
crate::error::CompletionError::UringIOError("no free fixed buffer slots"),
)?;
unsafe {
inner.ring.ring.submitter().register_buffers_update(
slot as u32,

View File

@@ -1,4 +1,3 @@
use super::MemoryIO;
use crate::{Clock, Completion, File, Instant, LimboError, OpenFlags, Result, IO};
use parking_lot::RwLock;
use std::io::{Read, Seek, Write};
@@ -90,7 +89,7 @@ impl File for WindowsFile {
#[instrument(err, skip_all, level = Level::TRACE)]
fn sync(&self, c: Completion) -> Result<Completion> {
let file = self.file.write();
file.sync_all().map_err(LimboError::IOError)?;
file.sync_all()?;
c.complete(0);
Ok(c)
}
@@ -98,7 +97,7 @@ impl File for WindowsFile {
#[instrument(err, skip_all, level = Level::TRACE)]
fn truncate(&self, len: usize, c: Completion) -> Result<Completion> {
let file = self.file.write();
file.set_len(len as u64).map_err(LimboError::IOError)?;
file.set_len(len as u64)?;
c.complete(0);
Ok(c)
}

View File

@@ -1309,9 +1309,9 @@ impl Connection {
Ok(result) => result,
// on windows, zero read will trigger UnexpectedEof
#[cfg(target_os = "windows")]
Err(LimboError::IOError(e)) if e.kind() == std::io::ErrorKind::UnexpectedEof => {
return Ok(false)
}
Err(LimboError::CompletionError(CompletionError::IOError(
std::io::ErrorKind::UnexpectedEof,
))) => return Ok(false),
Err(err) => return Err(err),
};