Skip to content

Commit 79e5011

Browse files
committed
chore: development v0.2.47 - comprehensive testing complete [auto-commit]
1 parent 744a2e9 commit 79e5011

File tree

21 files changed

+100
-28
lines changed

21 files changed

+100
-28
lines changed

Cargo.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ exclude = [
3737
# Workspace Package Metadata (inherited by all crates)
3838
# ─────────────────────────────────────────────────────────────────────────────
3939
[workspace.package]
40-
version = "0.2.46"
40+
version = "0.2.47"
4141
edition = "2024"
4242
rust-version = "1.85"
4343
license = "MPL-2.0 OR LicenseRef-UFFS-Commercial"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Traditional file search tools (including `os.walk`, `FindFirstFile`, etc.) work
2121

2222
**UFFS reads the MFT directly** - once - and queries it in memory using Polars DataFrames. This is like reading the entire phonebook once instead of looking up each name individually.
2323

24-
### Benchmark Results (v0.2.46)
24+
### Benchmark Results (v0.2.47)
2525

2626
| Drive Type | Records | Time | Throughput |
2727
|------------|---------|------|------------|
@@ -33,7 +33,7 @@ Traditional file search tools (including `os.walk`, `FindFirstFile`, etc.) work
3333

3434
| Comparison | Records | Time | Notes |
3535
|------------|---------|------|-------|
36-
| **UFFS v0.2.46** | **18.7 Million** | **~142 seconds** | All disks, fast mode |
36+
| **UFFS v0.2.47** | **18.7 Million** | **~142 seconds** | All disks, fast mode |
3737
| UFFS v0.1.30 | 18.7 Million | ~315 seconds | Baseline |
3838
| Everything | 19 Million | 178 seconds | All disks |
3939
| WizFile | 6.5 Million | 299 seconds | Single HDD |

crates/uffs-mft/src/io.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4117,8 +4117,7 @@ impl IocpMftReader {
41174117
// SAFETY: We need get_unchecked_mut to get a mutable reference to the
41184118
// pinned data for the OVERLAPPED pointer and buffer. The pin is maintained
41194119
// throughout the operation lifetime.
4120-
let overlapped_ptr =
4121-
unsafe { op.as_mut().get_unchecked_mut().as_overlapped_ptr() };
4120+
let overlapped_ptr = unsafe { op.as_mut().get_unchecked_mut().as_overlapped_ptr() };
41224121
let read_result = unsafe {
41234122
ReadFile(
41244123
handle,

crates/uffs-mft/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ use criterion as _;
5252
// Pipelining dependencies (used in io.rs PipelinedMftReader on Windows)
5353
#[cfg(windows)]
5454
use crossbeam_channel as _;
55-
// SmallVec for zero-copy parsing (used in io.rs on Windows)
56-
#[cfg(windows)]
57-
use smallvec as _;
5855
// Platform-gated dependencies (used on Windows only)
5956
#[cfg(not(windows))]
6057
use indicatif as _;
6158
#[cfg(windows)]
6259
use indicatif::{ProgressBar, ProgressStyle};
60+
// SmallVec for zero-copy parsing (used in io.rs on Windows)
61+
#[cfg(windows)]
62+
use smallvec as _;
6363
#[cfg(not(windows))]
6464
use tracing as _;
6565
#[cfg(windows)]

crates/uffs-mft/src/platform.rs

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use std::path::{Path, PathBuf};
1717
use windows::Win32::Foundation::{CloseHandle, HANDLE};
1818
use windows::Win32::Storage::FileSystem::{
1919
CreateFileW, FILE_FLAG_BACKUP_SEMANTICS, FILE_FLAG_NO_BUFFERING, FILE_FLAG_OPEN_REPARSE_POINT,
20-
FILE_FLAGS_AND_ATTRIBUTES, FILE_READ_ATTRIBUTES, FILE_SHARE_DELETE, FILE_SHARE_READ,
21-
FILE_SHARE_WRITE, OPEN_EXISTING, SYNCHRONIZE,
20+
FILE_FLAG_OVERLAPPED, FILE_FLAGS_AND_ATTRIBUTES, FILE_READ_ATTRIBUTES, FILE_SHARE_DELETE,
21+
FILE_SHARE_READ, FILE_SHARE_WRITE, OPEN_EXISTING, SYNCHRONIZE,
2222
};
2323

2424
/// FILE_READ_DATA access right (0x0001) - required to read data from a
@@ -238,6 +238,45 @@ impl VolumeHandle {
238238
self.handle
239239
}
240240

241+
/// Opens a new handle to the same volume with `FILE_FLAG_OVERLAPPED`.
242+
///
243+
/// This is required for IOCP (I/O Completion Port) operations which need
244+
/// overlapped I/O support. The returned handle is separate from the main
245+
/// handle and must be closed by the caller.
246+
///
247+
/// # Errors
248+
///
249+
/// Returns an error if the volume cannot be opened.
250+
#[allow(unsafe_code)] // Required: Windows FFI (CreateFileW)
251+
pub fn open_overlapped_handle(&self) -> Result<HANDLE> {
252+
use windows::core::PCWSTR;
253+
254+
let volume_path: Vec<u16> = format!("\\\\.\\{}:", self.volume)
255+
.encode_utf16()
256+
.chain(core::iter::once(0))
257+
.collect();
258+
259+
let handle = unsafe {
260+
CreateFileW(
261+
PCWSTR::from_raw(volume_path.as_ptr()),
262+
FILE_READ_DATA | FILE_READ_ATTRIBUTES.0 | SYNCHRONIZE.0,
263+
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
264+
None,
265+
OPEN_EXISTING,
266+
FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED,
267+
None,
268+
)
269+
};
270+
271+
match handle {
272+
Ok(h) => Ok(h),
273+
Err(err) => Err(MftError::VolumeOpen {
274+
volume: self.volume,
275+
source: std::io::Error::from_raw_os_error(err.code().0 as i32),
276+
}),
277+
}
278+
}
279+
241280
/// Returns the byte offset of the MFT on the volume.
242281
#[must_use]
243282
pub fn mft_byte_offset(&self) -> u64 {

0 commit comments

Comments
 (0)