-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8292562: (fc) Use copy_file_range in FileChannel::transferTo on Linux #9925
Conversation
👋 Welcome back bpb! A progress list of the required criteria for merging this PR into |
Webrevs
|
Aside from the check if copy_file_range is supported then I think the change to the transferTo implementation in c3c36f1 looks good. At some point I would expect we will pass the append flag from the java code. Have you looked at transferFrom for the append case? I suspect it is masked by the check for EBADF and now may be the time to re-examine that (okay to be a separate PR but hopefully you see the issue there). |
@bplb This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 116 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Agreed.
Yep, same problem.
Might as well go ahead and fix this in another rev of this PR. |
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.
I think this one is done.
Well, maybe it is now: the new test failed on macOS and Windows which do not have the problem reported in JDK-4950302. Fixed in commit ec2ad5d. |
A long standing issue is that FileChannel needs to specify how methods that take a position behave when a file is opened for append. This includes the transferXXX methods. It may be that transferFrom needs to be allowed to throw an exception when called on a FileChannel to a file opened for append. So maybe the simplest thing for now is to revert the test back to testing transferTo when the target is opened for append. That will be a simpler test to maintain. |
So changed in 6351c8d and limited to run on Linux only. |
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.
The test no longer needs to build jdk.test.lib.Platform, otherwise the update looks okay.
Ack. I had to forget something. Fixed in 6182d3b. |
Thanks. MIN_SIZE is a left-over too, we can get that the next time. |
/integrate |
Going to push as commit c74b6d4.
Your commit was automatically rebased without conflicts. |
Add
copy_file_range(2)
to the native Linux implementation ofFileChannel::transferTo
.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9925/head:pull/9925
$ git checkout pull/9925
Update a local copy of the PR:
$ git checkout pull/9925
$ git pull https://git.openjdk.org/jdk pull/9925/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 9925
View PR using the GUI difftool:
$ git pr show -t 9925
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9925.diff