Skip to content

feat: Use reflink_or_copy for export as well #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 21, 2025
Merged

feat: Use reflink_or_copy for export as well #137

merged 3 commits into from
Aug 21, 2025

Conversation

rklaehn
Copy link
Collaborator

@rklaehn rklaehn commented Aug 20, 2025

Description

Use reflink_or_copy when exporing, not just when importing.

Breaking Changes

None

Notes & open questions

Note: we lose progress, but for modern file systems it will be instant, so 🤷 . If you are a poor person having to live with Fat32, you can always use TryReference.

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

Copy link

github-actions bot commented Aug 20, 2025

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh-blobs/pr/137/docs/iroh_blobs/

Last updated: 2025-08-21T09:15:52Z

@n0bot n0bot bot added this to iroh Aug 20, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Aug 20, 2025
Copy link
Member

@matheus23 matheus23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the implementation of reflink_or_copy it should be pretty easy to have our cake and eat it too: We can try to reflink, and then do the fallback ourselves, and if we fall back, we keep using copy_with_progress, so we have progress.

@rklaehn
Copy link
Collaborator Author

rklaehn commented Aug 21, 2025

Looking at the implementation of reflink_or_copy it should be pretty easy to have our cake and eat it too: We can try to reflink, and then do the fallback ourselves, and if we fall back, we keep using copy_with_progress, so we have progress.

Good point. I had briefly looked at https://docs.rs/reflink-copy/latest/reflink_copy/fn.check_reflink_support.html, but it says that it just works on windows. But just trying it is better.

We have to do some convoluted shit because there is no generic sender/sink.
@rklaehn rklaehn requested a review from matheus23 August 21, 2025 09:14
Copy link
Member

@matheus23 matheus23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@rklaehn rklaehn merged commit 7925931 into main Aug 21, 2025
24 checks passed
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in iroh Aug 21, 2025
@rklaehn rklaehn deleted the reflink-export branch August 21, 2025 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants