-
-
Notifications
You must be signed in to change notification settings - Fork 7
Add reflink_block function #85
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I think we need to work on the API, the current API is not cross-platform and have too many platform dependent details
src/lib.rs
Outdated
/// - The destination region must not extend past the end of file. If the application wishes to | ||
/// extend the destination with cloned data, it must first call | ||
/// [`File::set_len`](fn@std::fs::File::set_len). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm...
File::set_len
is probably cheap on Linux, but this still makes the API slightly different on different platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In most cases, it should be possible to preallocate required space for the file on any platform. I would it as a better approach than writing platform specific code. We can add to documentation later
Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Signed-off-by: Vaiz <4908982+Vaiz@users.noreply.github.com>
@NobodyXu , hey, I won't have time to work on this PR in December. There's no rush to get it merged, so we can either leave it as is for now, or I can create a new PR later. If you prefer, feel free to finish it yourself |
That's totally fine, it's almost Christmas time and everyone is taking a break to relax themselves. There is no need to rush anything, wish you have a nice Christmas! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
A few comments about improving builder and the doc
* remove commented code * move mandatory arguments to constructor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Adding block-level reflink capabilities allows for more granular and efficient data management. This can be particularly beneficial for applications that need to clone or deduplicate specific segments of large files.
Details:
--ignored
with--include-ignored
for cargo test to enable all testsreflink_block
, although it should be possible to add linux support in the future without changing function signaturereflink_block
accepts immutable reference to target file to allow calling this function on the same fileissue: #80