Skip to content

feat: add ReFS filesystem detection for Windows reflink support - #3036

Merged
oferchen merged 3 commits into
masterfrom
feature/refs-detection
Mar 28, 2026
Merged

oferchen merged 3 commits into
masterfrom
feature/refs-detection

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Add ReFS filesystem detection via GetVolumeInformationByHandleW Win32 API
  • Volume-level caching of filesystem type (keyed by volume root path)
  • New CopyMethod::ReFsReflink variant wired into dispatch chain
  • Platform stubs for non-Windows (Ok(false))

Test plan

  • Verify is_refs_filesystem returns false on NTFS (Windows CI)
  • Verify non-Windows stub returns Ok(false) (macOS/Linux CI)
  • Verify cache clearing works
  • Verify CopyMethod::ReFsReflink in display and zero-copy checks

Add `refs_detect` module to `fast_io` crate that detects whether a path
resides on a Windows ReFS volume via `GetVolumeInformationByHandleW`.
This is the prerequisite for FSCTL_DUPLICATE_EXTENTS_TO_FILE (Windows
copy-on-write block cloning).

- Windows: queries volume filesystem name, caches results per volume root
- Non-Windows: stub returning Ok(false)
- Add `ReFsReflink` variant to `CopyMethod` enum
- Wire ReFS detection into Windows copy dispatch chain
- Comprehensive tests for caching, cross-platform stubs, error handling
@github-actions github-actions Bot added the enhancement New feature or request label Mar 28, 2026
@oferchen
oferchen merged commit e8ae70b into master Mar 28, 2026
35 checks passed
@oferchen
oferchen deleted the feature/refs-detection branch March 28, 2026 17:55
oferchen added a commit that referenced this pull request May 1, 2026
* feat: add ReFS filesystem detection for Windows reflink support

Add `refs_detect` module to `fast_io` crate that detects whether a path
resides on a Windows ReFS volume via `GetVolumeInformationByHandleW`.
This is the prerequisite for FSCTL_DUPLICATE_EXTENTS_TO_FILE (Windows
copy-on-write block cloning).

- Windows: queries volume filesystem name, caches results per volume root
- Non-Windows: stub returning Ok(false)
- Add `ReFsReflink` variant to `CopyMethod` enum
- Wire ReFS detection into Windows copy dispatch chain
- Comprehensive tests for caching, cross-platform stubs, error handling

* style: fix rustfmt line wrapping in dispatch.rs

* fix: add Win32_Security feature for CreateFileW in ReFS detection
oferchen added a commit that referenced this pull request May 5, 2026
* feat: add ReFS filesystem detection for Windows reflink support

Add `refs_detect` module to `fast_io` crate that detects whether a path
resides on a Windows ReFS volume via `GetVolumeInformationByHandleW`.
This is the prerequisite for FSCTL_DUPLICATE_EXTENTS_TO_FILE (Windows
copy-on-write block cloning).

- Windows: queries volume filesystem name, caches results per volume root
- Non-Windows: stub returning Ok(false)
- Add `ReFsReflink` variant to `CopyMethod` enum
- Wire ReFS detection into Windows copy dispatch chain
- Comprehensive tests for caching, cross-platform stubs, error handling

* style: fix rustfmt line wrapping in dispatch.rs

* fix: add Win32_Security feature for CreateFileW in ReFS detection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant