Proposal for adding O_DIRECT support into JDK 9

Lu, Yingqi at
Mon Sep 26 18:50:22 UTC 2016

Alan, you mean readv0/write0 or read0/write0? I just want to make sure :-)

Anyone else has other opinions on where is the best home for O_DIRECT flag? The flags under jdk.unsupported will eventually be removed in the future JDK release?

If we agree ExtendedOpenOpen is the best home for O_DIRECT, we can modify that for sure.


-----Original Message-----
From: Alan Bateman [mailto:Alan.Bateman at] 
Sent: Monday, September 26, 2016 11:42 AM
To: Lu, Yingqi < at>; core-libs-dev at
Cc: nio-dev at
Subject: Re: Proposal for adding O_DIRECT support into JDK 9

On 26/09/2016 19:17, Lu, Yingqi wrote:
> Hi All,
> The second version of the patch is now available at In this version, we moved the O_DIRECT support from FIS/FOS/RAF to FileChannel. We implemented O_DIRECT as a StandardOpenOption. The reason we did not make it as one of the ExtendedOpenOptions is because we found ExtendedOpenOption is now moved to jdk.unsupported. Please let us know if we misunderstood anything here. We can modify it accordingly if there is a better place to put this flag.
ExtendedOpenOption seems the right place for this (we haven't found a good home for this yet).

I skimmed the implementation and the changes to readv0/write0 are a concern - I suspect you'll need to hoist the bulk of this into FileChannelImpl so that most of this native code can be eliminated.


More information about the core-libs-dev mailing list