Repository navigation
feat: add Linux FICLONE reflink support via rustix - #3025
Merged
Merged
Conversation
Add copy-on-write reflink cloning using rustix::fs::ioctl_ficlone - fully safe, no raw FFI, zero new dependencies. On Btrfs, XFS (reflink enabled), and bcachefs, FICLONE creates instant O(1) clones sharing storage blocks until modification. Linux copy dispatch chain is now: FICLONE -> copy_file_range -> std::fs::copy. Graceful fallback on unsupported filesystems (ext4, tmpfs, NFS, FUSE). - Add CopyMethod::Ficlone variant with Display, is_zero_copy support - Add try_ficlone() standalone function and re-export from fast_io - Update platform_supports_reflink() to return true on Linux - Update platform_preferred_method() to prefer Ficlone on Linux - Add tests: graceful fallback, missing source, dispatch chain, stubs
oferchen
added a commit
that referenced
this pull request
May 1, 2026
Add copy-on-write reflink cloning using rustix::fs::ioctl_ficlone - fully safe, no raw FFI, zero new dependencies. On Btrfs, XFS (reflink enabled), and bcachefs, FICLONE creates instant O(1) clones sharing storage blocks until modification. Linux copy dispatch chain is now: FICLONE -> copy_file_range -> std::fs::copy. Graceful fallback on unsupported filesystems (ext4, tmpfs, NFS, FUSE). - Add CopyMethod::Ficlone variant with Display, is_zero_copy support - Add try_ficlone() standalone function and re-export from fast_io - Update platform_supports_reflink() to return true on Linux - Update platform_preferred_method() to prefer Ficlone on Linux - Add tests: graceful fallback, missing source, dispatch chain, stubs
oferchen
added a commit
that referenced
this pull request
May 5, 2026
Add copy-on-write reflink cloning using rustix::fs::ioctl_ficlone - fully safe, no raw FFI, zero new dependencies. On Btrfs, XFS (reflink enabled), and bcachefs, FICLONE creates instant O(1) clones sharing storage blocks until modification. Linux copy dispatch chain is now: FICLONE -> copy_file_range -> std::fs::copy. Graceful fallback on unsupported filesystems (ext4, tmpfs, NFS, FUSE). - Add CopyMethod::Ficlone variant with Display, is_zero_copy support - Add try_ficlone() standalone function and re-export from fast_io - Update platform_supports_reflink() to return true on Linux - Update platform_preferred_method() to prefer Ficlone on Linux - Add tests: graceful fallback, missing source, dispatch chain, stubs
Merged
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rustix::fs::ioctl_ficlone- fully safe, no raw FFI, zero new dependenciesChanges
CopyMethod::Ficlonevariant with Display and is_zero_copy supporttry_ficlone()standalone function re-exported from fast_ioplatform_supports_reflink()returns true on Linuxplatform_preferred_method()prefers Ficlone on LinuxTest plan