From 8204fbc8ec16c269a91c1fed6bf9e5150ff106c4 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Tue, 2 Sep 2025 14:14:04 +0300 Subject: [PATCH] simulator: Fix 64-bit offset build failures Fix brekage from first merging commit d959319b ("Merge 'Use u64 for file offsets in I/O and calculate such offsets in u64' from Preston Thorpe") and then commit 6591b66c ("Merge 'Simulate I/O in memory' from Pedro Muniz"), which was unaware of the changes. --- simulator/runner/memory/file.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/simulator/runner/memory/file.rs b/simulator/runner/memory/file.rs index 14ccfd344..e40fdfbb3 100644 --- a/simulator/runner/memory/file.rs +++ b/simulator/runner/memory/file.rs @@ -180,12 +180,12 @@ impl File for MemorySimFile { Ok(()) } - fn pread(&self, pos: usize, c: Completion) -> Result { + fn pread(&self, pos: u64, c: Completion) -> Result { self.io_tracker.borrow_mut().pread_calls += 1; let op = OperationType::Read { completion: c.clone(), - offset: pos, + offset: pos as usize, }; self.insert_op(op); Ok(c) @@ -193,7 +193,7 @@ impl File for MemorySimFile { fn pwrite( &self, - pos: usize, + pos: u64, buffer: Arc, c: Completion, ) -> Result { @@ -201,7 +201,7 @@ impl File for MemorySimFile { let op = OperationType::Write { buffer, completion: c.clone(), - offset: pos, + offset: pos as usize, }; self.insert_op(op); Ok(c) @@ -209,7 +209,7 @@ impl File for MemorySimFile { fn pwritev( &self, - pos: usize, + pos: u64, buffers: Vec>, c: Completion, ) -> Result { @@ -220,7 +220,7 @@ impl File for MemorySimFile { let op = OperationType::WriteV { buffers, completion: c.clone(), - offset: pos, + offset: pos as usize, }; self.insert_op(op); Ok(c) @@ -241,11 +241,11 @@ impl File for MemorySimFile { Ok(self.buffer.borrow().len() as u64) } - fn truncate(&self, len: usize, c: Completion) -> Result { + fn truncate(&self, len: u64, c: Completion) -> Result { self.io_tracker.borrow_mut().truncate_calls += 1; let op = OperationType::Truncate { completion: c.clone(), - len, + len: len as usize, }; self.insert_op(op); Ok(c)