Proposal for adding O_DIRECT support into JDK 9
Lu, Yingqi
yingqi.lu at intel.com
Thu Sep 14 17:20:30 UTC 2017
Hi Brian/Alan,
After taking another look at the code, I could not find an easy way to check the channel/file position inside IOUtil class for non-positional read/write (position is not provided as a parameter to FileChannel.read/write).
Do you think it is proper to just leave the channel position check inside FileChannelImpl like it is now?
Thanks,
Lucy
From: nio-dev [mailto:nio-dev-bounces at openjdk.java.net] On Behalf Of Lu, Yingqi
Sent: Thursday, September 14, 2017 9:40 AM
To: Alan Bateman <Alan.Bateman at oracle.com>; Brian Burkhalter <brian.burkhalter at oracle.com>
Cc: nio-dev at openjdk.java.net
Subject: RE: Proposal for adding O_DIRECT support into JDK 9
Hi Alan,
The remaining check in FileChannelImpl is to check if channel/file position is aligned. I think we still need the check, but we can move it to IOUtil class. Please let me know if there is anything I misunderstand.
I will submit version 13 today to incorporate your feedback.
Thanks,
Lucy
From: Alan Bateman [mailto:Alan.Bateman at oracle.com]
Sent: Thursday, September 14, 2017 5:25 AM
To: Lu, Yingqi <yingqi.lu at intel.com<mailto:yingqi.lu at intel.com>>; Brian Burkhalter <brian.burkhalter at oracle.com<mailto:brian.burkhalter at oracle.com>>
Cc: nio-dev at openjdk.java.net<mailto:nio-dev at openjdk.java.net>
Subject: Re: Proposal for adding O_DIRECT support into JDK 9
On 14/09/2017 00:50, Lu, Yingqi wrote:
Hi Brian,
Thank you for the feedback. Here is a newer version of the patch http://cr.openjdk.java.net/~kkharbas/8164900/webrev.12/<http://cr.openjdk.java.net/%7Ekkharbas/8164900/webrev.12/>
Just catching up on this again.
The check for alignment of the position and size of the remaining in readInto/writeFrom{NativeBuffer} looks right now. There is still a duplicate check in FileChannelImpl.read/write that I assume can be removed (it is easily defeated). I assume the protected modifier can be dropped from the new check methods in Util.
It looks like the first sentence in the FileStore::getBlockSize javadoc has been dropped in this version. A sentence to say that to returns the block size would be good to have as the first sentence.
-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20170914/854bb933/attachment-0001.html>
More information about the nio-dev
mailing list