RFR: 6980847: (fs) Files.copy needs to be tuned [v2]

Brian Burkhalter bpb at openjdk.java.net
Wed Jun 15 16:00:26 UTC 2022


On Wed, 15 Jun 2022 15:26:13 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   6980847: 1) use UnixFileStoreAttributes.get(file).blockSize(); 2) use @Native instead of transferSize0()
>
> src/java.base/unix/classes/sun/nio/fs/UnixCopyFile.java line 232:
> 
>> 230: 
>> 231:         while (u != v) {
>> 232:             if (u < v)
> 
> It might be worth a comment about the expected inputs so it is known to converge quickly.
> In the general case it might wrap around and go unstable.

Comment added in f151dc4cf6f4e59fff2d2a0f486929940cafb1ae.

> src/java.base/unix/classes/sun/nio/fs/UnixCopyFile.java line 664:
> 
>> 662:     // -- native methods --
>> 663: 
>> 664:     static native long transferSize0();
> 
> If the `transferSize` is fixed, there seems to be little reason to call native to retrieve it.
> (Perhaps hoping for the OS to provide it.)

I realized that myself and was already changing it when this comment appeared. Fixed in f151dc4cf6f4e59fff2d2a0f486929940cafb1ae.

-------------

PR: https://git.openjdk.org/jdk/pull/9161


More information about the nio-dev mailing list