diff --git a/core/io/io_uring.rs b/core/io/io_uring.rs index 0bf4543b6..aca0ed42f 100644 --- a/core/io/io_uring.rs +++ b/core/io/io_uring.rs @@ -400,7 +400,7 @@ impl WrappedIOUring { iov_allocation[0].iov_len as u32, id as u16, ) - .offset(st.file_pos as u64) + .offset(st.file_pos) .build() .user_data(key) } else { @@ -409,7 +409,7 @@ impl WrappedIOUring { iov_allocation[0].iov_base as *const u8, iov_allocation[0].iov_len as u32, ) - .offset(st.file_pos as u64) + .offset(st.file_pos) .build() .user_data(key) } @@ -425,7 +425,7 @@ impl WrappedIOUring { let entry = with_fd!(st.file_id, |fd| { io_uring::opcode::Writev::new(fd, ptr, iov_count as u32) - .offset(st.file_pos as u64) + .offset(st.file_pos) .build() .user_data(key) }); diff --git a/core/io/unix.rs b/core/io/unix.rs index f1c165ecc..1f7fbb8c7 100644 --- a/core/io/unix.rs +++ b/core/io/unix.rs @@ -15,8 +15,6 @@ use std::{io::ErrorKind, sync::Arc}; use tracing::debug; use tracing::{instrument, trace, Level}; -/// UnixIO lives longer than any of the files it creates, so it is -/// safe to store references to it's internals in the UnixFiles pub struct UnixIO {} unsafe impl Send for UnixIO {} @@ -233,7 +231,7 @@ impl File for UnixFile { } let file = self.file.lock(); - match try_pwritev_raw(file.as_raw_fd(), pos as u64, &buffers, 0, 0) { + match try_pwritev_raw(file.as_raw_fd(), pos, &buffers, 0, 0) { Ok(written) => { trace!("pwritev wrote {written}"); c.complete(written as i32); @@ -285,7 +283,7 @@ impl File for UnixFile { #[instrument(err, skip_all, level = Level::INFO)] fn truncate(&self, len: u64, c: Completion) -> Result { let file = self.file.lock(); - let result = file.set_len(len as u64); + let result = file.set_len(len); match result { Ok(()) => { trace!("file truncated to len=({})", len); diff --git a/core/storage/wal.rs b/core/storage/wal.rs index b0eb16034..816782376 100644 --- a/core/storage/wal.rs +++ b/core/storage/wal.rs @@ -1565,8 +1565,7 @@ impl WalFile { fn frame_offset(&self, frame_id: u64) -> u64 { assert!(frame_id > 0, "Frame ID must be 1-based"); let page_offset = (frame_id - 1) * (self.page_size() + WAL_FRAME_HEADER_SIZE as u32) as u64; - let offset = WAL_HEADER_SIZE as u64 + page_offset; - offset + WAL_HEADER_SIZE as u64 + page_offset } #[allow(clippy::mut_from_ref)] @@ -2293,7 +2292,7 @@ pub mod test { let done = Rc::new(Cell::new(false)); let _done = done.clone(); let _ = file.file.truncate( - WAL_HEADER_SIZE, + WAL_HEADER_SIZE as u64, Completion::new_trunc(move |_| { let done = _done.clone(); done.set(true); diff --git a/tests/integration/query_processing/test_btree.rs b/tests/integration/query_processing/test_btree.rs index 0d174e50c..1355d81e8 100644 --- a/tests/integration/query_processing/test_btree.rs +++ b/tests/integration/query_processing/test_btree.rs @@ -434,7 +434,7 @@ fn write_at(io: &impl IO, file: Arc, offset: usize, data: &[u8]) { // reference the buffer to keep alive for async io let _buf = _buf.clone(); }); - let result = file.pwrite(offset, buffer, completion).unwrap(); + let result = file.pwrite(offset as u64, buffer, completion).unwrap(); while !result.is_completed() { io.run_once().unwrap(); }