-
Notifications
You must be signed in to change notification settings - Fork 13
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
Implement linux copy algorithms using syscalls #312
Conversation
Thanks for the PRs! I was swamped with other things last week. I'll finish the reviews (including the other one) this week. Bear with me... |
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.
This PR looks great to me! I like the new sparse copy functions and the fall-back policy.
I left just a few minor comments.
In addition to that, could you apply clang-format on your side?
There is a clang-format file in the root directory.
Thanks for reviewing Regarding running clang-format: the style in the |
That's a catch! I investigated the .clang-format file and found that setting DerivePointerAlignment to true ignores the PointerAlignment option. As it's confusing, I'll update the entire code so that it matches with the 'left' style. |
I'll merge this PR once the CI has passed. |
This PR implements the various linux file copy algorithms using syscalls instead of relying on
cp
.Implemented algorithms:
ioctl(2)
copy_file_range
Additionally, adds a fallback mechanism to the sparse copy and clone function that tries the "worse" options after failing to use the "good" algorithm. E.g. clone tries clone -> sparse_copy -> in-kernel dense copy -> dense-copy. And fails only if all of them fail.
Edit: this is related to #297